--- 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('',
--- 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.
--- 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)