From 1cca312e120dc3bef99286fe42d2958f9513581c Mon Sep 17 00:00:00 2001 From: Nishanth Amuluru Date: Fri, 7 Jan 2011 13:18:09 +0530 Subject: fixed few typos --- profile/urls.py | 2 +- profile/utils.py | 1 + profile/views.py | 15 ++++++++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/profile/urls.py b/profile/urls.py index 33fe4df..0949c66 100644 --- a/profile/urls.py +++ b/profile/urls.py @@ -2,7 +2,7 @@ from django.conf.urls.defaults import * from pytask.profile.views import view_profile, edit_profile,\ browse_notifications, view_notification,\ - delte_notification, unread_notification + delete_notification, unread_notification urlpatterns = patterns('', diff --git a/profile/utils.py b/profile/utils.py index 00cfaec..84b5e00 100644 --- a/profile/utils.py +++ b/profile/utils.py @@ -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 --git a/profile/views.py b/profile/views.py index 8dfed4a..0ed6afc 100755 --- a/profile/views.py +++ b/profile/views.py @@ -112,13 +112,16 @@ def delete_notification(request, nid): '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 @@ def unread_notification(request, nid) '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) -- cgit