1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

14799 Fix sync of scripts from data source (#15303)

* 14799 fix script creation from data-source

* 14799 dont cache module_scripts

* 14799 fix sync_classes call
This commit is contained in:
Arthur Hanson
2024-03-26 05:36:36 -07:00
committed by GitHub
parent 817e009e4f
commit 0cff4c9795
2 changed files with 12 additions and 5 deletions

View File

@@ -89,6 +89,9 @@ class ManagedFile(SyncedDataMixin, models.Model):
def clean(self):
super().clean()
if self.data_file and not self.file_path:
self.file_path = os.path.basename(self.data_path)
# Ensure that the file root and path make a unique pair
if self._meta.model.objects.filter(file_root=self.file_root, file_path=self.file_path).exclude(pk=self.pk).exists():
raise ValidationError(