Skip to content

Commit

Permalink
fix(generic): the permission string must also contain the app_label
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rger committed Jan 26, 2024
1 parent 7c8d861 commit 8140a3d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions apis_core/generic/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ def get_template_names(self):

def get_permission_required(self):
if hasattr(self, "permission_action_required"):
return [
get_permission_codename(
self.permission_action_required, self.model._meta
)
]
permission_codename = get_permission_codename(
self.permission_action_required, self.model._meta
)
permission = f"{self.model._meta.app_label}.{permission_codename}"
return [permission]
return []


Expand Down

0 comments on commit 8140a3d

Please sign in to comment.