Skip to content

Commit

Permalink
Updated admin to check querystring parameters and use the obj instanc…
Browse files Browse the repository at this point in the history
…e instead of the object_id. (#444)
  • Loading branch information
jackton1 authored Aug 12, 2021
1 parent d8da6a7 commit 05a998e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion model_clone/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def change_view(self, request, object_id, form_url="", extra_context=None):

obj = self.get_object(request, unquote(object_id), to_field)

if object_id is not None and request.GET.get("duplicate"):
if obj is not None and request.GET.get("duplicate") == "true":
clone = obj.make_clone()
clone.save()
self.message_user(
Expand Down

0 comments on commit 05a998e

Please sign in to comment.