diff --git a/netbox/extras/models/configs.py b/netbox/extras/models/configs.py index 8c6b3273a..731288139 100644 --- a/netbox/extras/models/configs.py +++ b/netbox/extras/models/configs.py @@ -141,7 +141,6 @@ class ConfigContext(SyncedDataMixin, ChangeLoggedModel): Synchronize context data from the designated DataFile (if any). """ self.data = self.data_file.get_data() - self.data_synced = timezone.now() class ConfigContextModel(models.Model): @@ -227,7 +226,6 @@ class ConfigTemplate(SyncedDataMixin, ExportTemplatesMixin, TagsMixin, ChangeLog Synchronize template content from the designated DataFile (if any). """ self.template_code = self.data_file.data_as_string - self.data_synced = timezone.now() def render(self, context=None): """ diff --git a/netbox/extras/models/models.py b/netbox/extras/models/models.py index 9b7dcce33..b0c6d7fe3 100644 --- a/netbox/extras/models/models.py +++ b/netbox/extras/models/models.py @@ -354,7 +354,6 @@ class ExportTemplate(SyncedDataMixin, ExportTemplatesMixin, ChangeLoggedModel): Synchronize template content from the designated DataFile (if any). """ self.template_code = self.data_file.data_as_string - self.data_synced = timezone.now() def render(self, queryset): """ diff --git a/netbox/netbox/models/features.py b/netbox/netbox/models/features.py index 0e4b37125..2144d1c0f 100644 --- a/netbox/netbox/models/features.py +++ b/netbox/netbox/models/features.py @@ -6,6 +6,7 @@ from django.core.validators import ValidationError from django.db import models from django.db.models.signals import class_prepared from django.dispatch import receiver +from django.utils import timezone from django.utils.translation import gettext as _ from taggit.managers import TaggableManager @@ -377,6 +378,7 @@ class SyncedDataMixin(models.Model): self.data_source = self.data_file.source self.data_path = self.data_file.path self.sync_data() + self.data_synced = timezone.now() else: self.data_source = None self.data_path = ''