diff options
author | Nishanth Amuluru | 2011-01-07 13:18:09 +0530 |
---|---|---|
committer | Nishanth Amuluru | 2011-01-07 13:18:09 +0530 |
commit | 1cca312e120dc3bef99286fe42d2958f9513581c (patch) | |
tree | aca4244f9231568736a5fa8d750209a3f5186b12 | |
parent | d09ea0c24e17aac64f10bebe8064ab4ff4b462b5 (diff) | |
download | pytask-1cca312e120dc3bef99286fe42d2958f9513581c.tar.gz pytask-1cca312e120dc3bef99286fe42d2958f9513581c.tar.bz2 pytask-1cca312e120dc3bef99286fe42d2958f9513581c.zip |
fixed few typos
-rw-r--r-- | profile/urls.py | 2 | ||||
-rw-r--r-- | profile/utils.py | 1 | ||||
-rwxr-xr-x | 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) |