diff --git a/src/etools/applications/users/models.py b/src/etools/applications/users/models.py index 3ad2123af..fbe3d6f9b 100644 --- a/src/etools/applications/users/models.py +++ b/src/etools/applications/users/models.py @@ -9,6 +9,7 @@ from django.core.validators import MaxValueValidator, MinValueValidator from django.db import connection, models from django.db.models.signals import post_save +from django.urls import reverse from django.utils.functional import cached_property from django.utils.translation import gettext_lazy as _ @@ -99,6 +100,10 @@ def get_staff_member_country(self): return country return None + def get_admin_url(self): + info = (self._meta.app_label, self._meta.model_name) + return reverse('admin:%s_%s_change' % info, args=(self.pk,)) + def save(self, *args, **kwargs): if self.email != self.email.lower(): raise ValidationError("Email must be lowercase.") diff --git a/src/etools/templates/admin/base_site.html b/src/etools/templates/admin/base_site.html index 9a26b5c38..c97f0cc8d 100644 --- a/src/etools/templates/admin/base_site.html +++ b/src/etools/templates/admin/base_site.html @@ -150,7 +150,10 @@