Code review comment for lp:~cjohnston/qa-dashboard/user-edit-profile

Revision history for this message
Chris Johnston (cjohnston) wrote :

> 1) This looks a little shady:
> 216 + try:
> 217 + profile = UserProfile.objects.get(user=request.user)
> 218 + except UserProfile.DoesNotExist:
> 219 + profile = UserProfile(user=request.user)
> Why would request.user not exist?
>

It isn't trying request.user, it's trying the UserProfile, which a user may or may not have.

> 2) This seems too verbose:
> 165 - <li>Logged in as: <a href="http://launchpad.net/~{{ user.username
> }}">{{ user.username }}</a></li>
> 166 + <li>Logged in as: <strong><a href="http://launchpad.net/~{{
> user.username }}">{{ user.username }}</a></strong></li>
> 167 + <li><a href="{% url 'edit_profile' %}">Edit profile</a>
>
> Why not just have the logged-in link take you to your profile. ie:
>
> <li>Logged in as: <a href="{% url 'edit_profile' %}">{{ user.username
> }}</a></li>

Is that obvious enough? Would people know that they can click it to change their settings?

« Back to merge proposal