Only logged in users can view user profile.
--- a/taskapp/views/user.py Fri Feb 12 23:30:57 2010 +0530
+++ b/taskapp/views/user.py Mon Feb 15 15:14:27 2010 +0530
@@ -6,6 +6,8 @@
from django.contrib.auth import login, logout, authenticate
from django.contrib.auth.models import User
from pytask.taskapp.models import Profile
+from django.contrib.auth.decorators import login_required
+
def show_msg(message, redirect_url=None, url_desc=None):
""" simply redirect to homepage """
@@ -99,6 +101,7 @@
logout(request)
return show_msg('You have logged off successfully!!!')
+@login_required
def view_my_profile(request,uid):
""" allows the user to view the profiles of users """
edit_profile = True if request.user == User.objects.get(pk=uid) else False