summaryrefslogtreecommitdiff
path: root/taskapp/views
diff options
context:
space:
mode:
authoranoop2010-02-17 18:55:01 +0530
committeranoop2010-02-17 18:55:01 +0530
commit18d5bf1a0a718be3ba0c33fcbc259e6836ab6d1f (patch)
tree4425d827a1d2220a78eb458eafd123f178af1da6 /taskapp/views
parent6a0ef97f0849aad9fc2cb53751caab310fc44f2c (diff)
downloadpytask-18d5bf1a0a718be3ba0c33fcbc259e6836ab6d1f.tar.gz
pytask-18d5bf1a0a718be3ba0c33fcbc259e6836ab6d1f.tar.bz2
pytask-18d5bf1a0a718be3ba0c33fcbc259e6836ab6d1f.zip
started using django-registration default backend, removed browse users functionality.
Diffstat (limited to 'taskapp/views')
-rw-r--r--taskapp/views/user.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/taskapp/views/user.py b/taskapp/views/user.py
index 7f028d1..20562e7 100644
--- a/taskapp/views/user.py
+++ b/taskapp/views/user.py
@@ -1,4 +1,4 @@
-from django.http import HttpResponse
+from django.http import HttpResponse, Http404
from django.shortcuts import redirect, render_to_response
from pytask.taskapp.models import Task
from pytask.taskapp.forms.user import UserProfileEditForm
@@ -48,8 +48,12 @@ def homepage(request):
return render_to_response('index.html', context)
@login_required
-def view_my_profile(request,uid):
+def view_my_profile(request,uid=None):
""" allows the user to view the profiles of users """
+ if uid == None:
+ edit_profile = True
+ profile = Profile.objects.get(user = request.user)
+ return render_to_response('user/my_profile.html', {'edit_profile':edit_profile,'profile':profile})
edit_profile = True if request.user == User.objects.get(pk=uid) else False
try:
profile = Profile.objects.get(user = User.objects.get(pk=uid))
@@ -78,6 +82,3 @@ def edit_my_profile(request):
edit_profile_form = UserProfileEditForm(instance = profile)
return render_to_response('user/edit_profile.html',{'edit_profile_form' : edit_profile_form})
-def browse_users(request):
- userlist = User.objects.order_by('username')
- return render_to_response('user/browse.html',{'userlist':userlist})