Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not force that deletion can only be done by superuser #1359

Merged
merged 4 commits into from
Jul 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions rocky/tools/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ def get_readonly_fields(self, request, obj=None):
class OrganizationAdmin(AdminErrorMessageMixin, admin.ModelAdmin):
list_display = ["name", "code", "tags"]

def has_delete_permission(self, request, obj=None):
return request.user.is_superuser

def get_readonly_fields(self, request, obj=None):
# Obj is None when adding an organization and in that case we don't make
# code read only so it is possible to specify the code when creating an
Expand All @@ -63,9 +60,6 @@ def get_readonly_fields(self, request, obj=None):
class OrganizationMemberAdmin(admin.ModelAdmin):
list_display = ("user", "organization")

def has_delete_permission(self, request, obj=None):
return request.user.is_superuser


class IndemnificationAdmin(admin.ModelAdmin):
list_display = ("organization", "user")
Expand All @@ -76,9 +70,6 @@ def get_readonly_fields(self, request, obj=None):
else:
return []

def has_delete_permission(self, request, obj=None):
return request.user.is_superuser


class OrganizationTagAdmin(admin.ModelAdmin):
pass
Expand Down