Skip to content

Commit

Permalink
QuickFix: Enable adding new attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
Kani999 committed Sep 7, 2023
1 parent e338844 commit 99c3aeb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion netbox_attachments/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.0.2"
__version__ = "2.0.3"
6 changes: 3 additions & 3 deletions netbox_attachments/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ class NetBoxAttachmentEditView(generic.ObjectEditView):
def alter_object(self, instance, request, args, kwargs):
if not instance.pk:
# Assign the parent object based on URL kwargs
content_type = get_object_or_404(
instance.content_type = get_object_or_404(
ContentType, pk=request.GET.get('content_type'))
instance.parent = get_object_or_404(
content_type.model_class(), pk=request.GET.get('object_id'))
instance.object_id = request.GET.get('object_id')

return instance

def get_extra_addanother_params(self, request):
Expand Down

0 comments on commit 99c3aeb

Please sign in to comment.