Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
fix(admin): ⚰️ Allow superusers to be deleted in admin pannel
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Gray <44288823+mmoomocow@users.noreply.github.com>
  • Loading branch information
mmoomocow committed May 18, 2023
1 parent 89a4357 commit 0a52f88
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions users/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,4 @@ class UserAdmin(BaseUserAdmin):
)
},
),
)

def delete_model(self, request, obj) -> bool:
"""Override the delete method to prevent deletion of the superuser."""
if obj.is_superuser:
return False
super().delete_model(request, obj)
return True
)

0 comments on commit 0a52f88

Please sign in to comment.