allow user to view his own profile regardless of the public_profile_field value

Issue #6 resolved
Anonymous created an issue

I know no easy way to check this in template, so here is a trivial patch. I hope it has no security side effects.
{{{

!python

--- views.py_def 2009-03-23 16:10:18.000000000 +0200
+++ views.py 2009-03-23 17:21:35.000000000 +0200
@@ -257,7 +257,9 @@
profile
The user's profile, or None if the user's profile is not
publicly viewable (see the description of
- public_profile_field above).
+ public_profile_field above). The value of
+ public_profile_field is ignored if user is trying to get
+ his own profile (if request.user == user).

 **Template:**

@@ -270,7 +272,7 @@
profile_obj = user.get_profile()
except ObjectDoesNotExist:
raise Http404
- if public_profile_field is not None and \ + if request.user != user and public_profile_field is not None and \ not getattr(profile_obj, public_profile_field):
profile_obj = None
}}}

Comments (2)

  1. Log in to comment