diff --git a/src/postorius/templates/postorius/user_profile.html b/src/postorius/templates/postorius/user_profile.html
index 48bbd12..4376b7c 100644
--- a/src/postorius/templates/postorius/user_profile.html
+++ b/src/postorius/templates/postorius/user_profile.html
@@ -11,15 +11,27 @@
{% trans "User Profile" %} - {{ user }}
-
-
- {% trans 'Mailman display name' %} |
- {{ mm_user.display_name}} |
-
-
- {% trans 'User name' %} |
- {{ user.username}} |
-
-
+
+
+ {% trans 'Mailman display name' %} |
+ {{ mm_user.display_name}} |
+
+
+ {% trans 'User name' %} |
+ {{ user.username}} |
+
+
+ {% trans 'Main email' %} |
+ {{ user.email}} |
+
+
+ {% trans 'Other emails' %} |
+
+ {% for email in other_emails %}
+ - {{ email }}
+ {% endfor %}
+ |
+
+
{% endblock main %}
diff --git a/src/postorius/views/generic.py b/src/postorius/views/generic.py
index 8fd1bdb..e97fb45 100644
--- a/src/postorius/views/generic.py
+++ b/src/postorius/views/generic.py
@@ -85,7 +85,7 @@
"""A generic view for everything based on a mailman.client
user object.
- Sets self.mm_user to list object if user_id in **kwargs.
+ Sets self.mm_user to user object if user_id in **kwargs.
"""
def _get_first_address(self, user_obj):
diff --git a/src/postorius/views/user.py b/src/postorius/views/user.py
index c9c26e0..c94133d 100644
--- a/src/postorius/views/user.py
+++ b/src/postorius/views/user.py
@@ -304,12 +304,22 @@
@login_required()
def user_profile(request, user_email=None):
- # try:
- # the_user = User.objects.get(email=user_email)
- # except MailmanApiError:
- # return utils.render_api_error(request)
+ try:
+ mm_user = MailmanUser.objects.get(address=request.user.email)
+ other_emails = [
+ str(address) for address in mm_user.addresses
+ if address.verified_on is not None
+ ]
+ if request.user.email in other_emails:
+ other_emails.remove(request.user.email)
+ except MailmanApiError:
+ return utils.render_api_error(request)
+ except Mailman404Error:
+ # The user does not have a mailman user associated with it.
+ user_emails = []
return render_to_response('postorius/user_profile.html',
- # {'mm_user': the_user},
+ {'mm_user': mm_user,
+ 'other_emails': other_emails},
context_instance=RequestContext(request))