summaryrefslogtreecommitdiff
path: root/main/models.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-11-30 13:55:36 -0600
committerDan McGee <dan@archlinux.org>2011-11-30 13:55:36 -0600
commit6b8ef446bcd6a1cbc794d0846968e806034d3aad (patch)
treeb9e6fcba31717369953fa330f179cd48fc4fbea1 /main/models.py
parentda61fed4be6a28c870580f448c7c486f46d7b088 (diff)
Add master key overview page
And a bunch of text that may suck, but is better than nothing. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'main/models.py')
-rw-r--r--main/models.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/main/models.py b/main/models.py
index 990cc8ca..9156fb51 100644
--- a/main/models.py
+++ b/main/models.py
@@ -53,6 +53,18 @@ class UserProfile(models.Model):
verbose_name = 'Additional Profile Data'
verbose_name_plural = 'Additional Profile Data'
+ def get_absolute_url(self):
+ # TODO: this is disgusting. find a way to consolidate this logic with
+ # public.views.userlist among other places, and make some constants or
+ # something so we aren't using copies of string names everywhere.
+ group_names = self.user.groups.values_list('name', flat=True)
+ if "Developers" in group_names:
+ prefix = "developers"
+ elif "Trusted Users" in group_names:
+ prefix = "trustedusers"
+ else:
+ prefix = "fellows"
+ return '/%s/#%s' % (prefix, self.user.username)
class TodolistManager(models.Manager):
def incomplete(self):