From 1987647cc382e3f2274d1f65d086b18dd08917b1 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Tue, 28 Dec 2021 13:06:27 -0500 Subject: [PATCH] Closes #8175: Display parent object when attaching an image --- docs/release-notes/version-3.1.md | 1 + netbox/extras/views.py | 1 + .../templates/extras/imageattachment_edit.html | 16 ++++++++++++++++ 3 files changed, 18 insertions(+) create mode 100644 netbox/templates/extras/imageattachment_edit.html diff --git a/docs/release-notes/version-3.1.md b/docs/release-notes/version-3.1.md index d50404261..2b8744032 100644 --- a/docs/release-notes/version-3.1.md +++ b/docs/release-notes/version-3.1.md @@ -6,6 +6,7 @@ * [#6782](https://github.com/netbox-community/netbox/issues/6782) - Enable the inclusion of custom links in tables * [#8100](https://github.com/netbox-community/netbox/issues/8100) - Add "other" choice for FHRP group protocol +* [#8175](https://github.com/netbox-community/netbox/issues/8175) - Display parent object when attaching an image ### Bug Fixes diff --git a/netbox/extras/views.py b/netbox/extras/views.py index d5d36d364..15f3ca48a 100644 --- a/netbox/extras/views.py +++ b/netbox/extras/views.py @@ -472,6 +472,7 @@ class ObjectChangeLogView(View): class ImageAttachmentEditView(generic.ObjectEditView): queryset = ImageAttachment.objects.all() model_form = forms.ImageAttachmentForm + template_name = 'extras/imageattachment_edit.html' def alter_obj(self, instance, request, args, kwargs): if not instance.pk: diff --git a/netbox/templates/extras/imageattachment_edit.html b/netbox/templates/extras/imageattachment_edit.html new file mode 100644 index 000000000..cd7d40a8e --- /dev/null +++ b/netbox/templates/extras/imageattachment_edit.html @@ -0,0 +1,16 @@ +{% extends 'generic/object_edit.html' %} +{% load helpers %} + +{% block form_fields %} +
+ + +
+ {{ block.super }} +{% endblock form_fields %}