Don't link to the user details of admin or staff
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -29,6 +29,13 @@ class ObjectLinkWidget(object):
|
||||
except AttributeError:
|
||||
url = None
|
||||
|
||||
if getattr(value, 'is_staff', None) or getattr(value, 'is_superuser', None):
|
||||
# Don't display a anchor to for the user details view for
|
||||
# superusers and staff, the details view filters them. Staff
|
||||
# and admin users are not manageable by the normal user views.
|
||||
url = '#'
|
||||
return '{}{}'.format(object_type, label)
|
||||
|
||||
return self.template.render(
|
||||
context=Context(
|
||||
{'label': label, 'object_type': object_type, 'url': url or '#'}
|
||||
|
||||
Reference in New Issue
Block a user