# HG changeset patch # User Nishanth Amuluru # Date 1294386489 -19800 # Node ID 869a9ab7e2df4f15655758360f274334c22a261a # Parent d24b4a7147d25671582a3f4e21a7038febadd542 fixed few typos diff -r d24b4a7147d2 -r 869a9ab7e2df profile/urls.py --- a/profile/urls.py Fri Jan 07 13:11:51 2011 +0530 +++ b/profile/urls.py Fri Jan 07 13:18:09 2011 +0530 @@ -2,7 +2,7 @@ from pytask.profile.views import view_profile, edit_profile,\ browse_notifications, view_notification,\ - delte_notification, unread_notification + delete_notification, unread_notification urlpatterns = patterns('', diff -r d24b4a7147d2 -r 869a9ab7e2df profile/utils.py --- a/profile/utils.py Fri Jan 07 13:11:51 2011 +0530 +++ b/profile/utils.py Fri Jan 07 13:18:09 2011 +0530 @@ -1,3 +1,4 @@ +from pytask.profile.models import Notification def get_notification(nid, user): """ if notification exists, and belongs to the current user, return it. diff -r d24b4a7147d2 -r 869a9ab7e2df profile/views.py --- a/profile/views.py Fri Jan 07 13:11:51 2011 +0530 +++ b/profile/views.py Fri Jan 07 13:18:09 2011 +0530 @@ -112,13 +112,16 @@ 'older':older, 'oldest':oldest, } - redirect_url = "/profile/notf/" + \ - "view/nid=%s"%older.uniq_key if older else "browse" + + if older: + redirect_url = "/profile/notf/view/nid=%s"%older.uniq_key + else: + redirect_url = "/profile/notf/browse" return redirect(redirect_url) @login_required -def unread_notification(request, nid) +def unread_notification(request, nid): """ check if the user owns the notification and delete it. """ @@ -140,7 +143,9 @@ 'oldest':oldest, } - redirect_url = "/profile/notf/" + \ - "view/nid=%s"%older.uniq_key if older else "browse" + if older: + redirect_url = "/profile/notf/view/nid=%s"%older.uniq_key + else: + redirect_url = "/profile/notf/browse" return redirect(redirect_url)