diff mbox

[Branch,~linaro-validation/lava-server/trunk] Rev 306: Fix me page when the user has no full name

Message ID 20111129093717.13982.44785.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Zygmunt Krynicki Nov. 29, 2011, 9:37 a.m. UTC
------------------------------------------------------------
revno: 306
committer: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
branch nick: lava-server
timestamp: Tue 2011-11-22 17:26:07 +0100
message:
  Fix me page when the user has no full name
modified:
  lava_server/templates/me.html
  lava_server/views.py


--
lp:lava-server
https://code.launchpad.net/~linaro-validation/lava-server/trunk

You are subscribed to branch lp:lava-server.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-server/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_server/templates/me.html'
--- lava_server/templates/me.html	2011-11-08 23:55:06 +0000
+++ lava_server/templates/me.html	2011-11-22 16:26:07 +0000
@@ -13,7 +13,7 @@ 
 {% endblock %}
 
 {% block content %}
-<h2>Hi {{ user.first_name }}</h2>
+<h2>Hi {% firstof user.first_name user.username %}</h2>
 <p>This is where more interesting things about your actions will show up,
 eventually</p>
 {% endblock %}

=== modified file 'lava_server/views.py'
--- lava_server/views.py	2011-10-27 23:25:01 +0000
+++ lava_server/views.py	2011-11-22 16:26:07 +0000
@@ -50,7 +50,8 @@ 
 @login_required
 def me(request):
     data = {
-        'bread_crumb_trail': BreadCrumbTrail.leading_to(me, you=request.user.get_full_name())
+        'bread_crumb_trail': BreadCrumbTrail.leading_to(
+            me, you=request.user.get_full_name() or request.user.username)
     }
     context = RequestContext(request, data)
     template = loader.get_template('me.html')