Commit 3a60e9f927459aeec1a391da299750628a3688e0
1 parent
72c200d4
Exists in
master
and in
39 other branches
Listing user's email address
only to logged users
Showing
2 changed files
with
11 additions
and
0 deletions
Show diff stats
src/accounts/templates/accounts/user_detail.html
... | ... | @@ -24,6 +24,14 @@ |
24 | 24 | {% endifequal %} |
25 | 25 | |
26 | 26 | <div class="divider"></div> |
27 | + {% if request.user.is_active %} | |
28 | + <ul class="unstyled-list"> | |
29 | + {% for email in request.user.emails.iterator %} | |
30 | + <li><span class="icon-envelope icon-fixed-width"></span> {{ email.address }}</li> | |
31 | + {% endfor %} | |
32 | + </ul> | |
33 | + <div class="divider"></div> | |
34 | + {% endif %} | |
27 | 35 | |
28 | 36 | <ul class="unstyled-list"> |
29 | 37 | {% if user_.institution or user_.role %} | ... | ... |
src/super_archives/models.py
... | ... | @@ -41,6 +41,9 @@ class EmailAddress(models.Model): |
41 | 41 | real_name = models.CharField(max_length=64, blank=True, db_index=True) |
42 | 42 | md5 = models.CharField(max_length=32, null=True) |
43 | 43 | |
44 | + class Meta: | |
45 | + ordering = ('id', ) | |
46 | + | |
44 | 47 | def save(self, *args, **kwargs): |
45 | 48 | self.md5 = md5(self.address).hexdigest() |
46 | 49 | super(EmailAddress, self).save(*args, **kwargs) | ... | ... |