fix api permission error message
This commit is contained in:
parent
2bbd3e7994
commit
478057e515
1 changed files with 1 additions and 1 deletions
|
@ -109,7 +109,7 @@ class APIKeyAuth(APIKeyHeader):
|
|||
raise APIPermissionDenied('You need to have admin rights for this endpoint.')
|
||||
for permission in self.permissions:
|
||||
if not getattr(request.user_permissions, permission):
|
||||
raise APIPermissionDenied('You need to have the "%s" permission for this endpoint.')
|
||||
raise APIPermissionDenied('You need to have the "%s" permission for this endpoint.' % permission)
|
||||
if request.method == 'GET' and self.is_readonly:
|
||||
raise ValueError('this makes no sense for GET')
|
||||
if request.method != 'GET' and not self.is_readonly and auth_result.readonly:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue