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

Closes #7812: Enable change logging for image attachments

This commit is contained in:
jeremystretch
2021-11-17 11:49:11 -05:00
parent b7b5a5788f
commit 424ac29131
4 changed files with 29 additions and 2 deletions

View File

@@ -317,7 +317,8 @@ class ExportTemplate(ChangeLoggedModel):
return response
class ImageAttachment(BigIDModel):
@extras_features('webhooks')
class ImageAttachment(ChangeLoggedModel):
"""
An uploaded image which is associated with an object.
"""
@@ -341,6 +342,7 @@ class ImageAttachment(BigIDModel):
max_length=50,
blank=True
)
# ChangeLoggingMixin.created is a DateField
created = models.DateTimeField(
auto_now_add=True
)
@@ -390,6 +392,9 @@ class ImageAttachment(BigIDModel):
except tuple(expected_exceptions):
return None
def to_objectchange(self, action):
return super().to_objectchange(action, related_object=self.parent)
@extras_features('webhooks')
class JournalEntry(ChangeLoggedModel):