profile/views.py
author Nishanth Amuluru <nishanth@fossee.in>
Fri, 07 Jan 2011 13:18:48 +0530
changeset 51 4607a50e7f00
parent 50 869a9ab7e2df
child 63 e346fd52baff
permissions -rwxr-xr-x
removed unwanted prints
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28
4dfcc826b241 Created a view for viewing profile
Nishanth Amuluru <nishanth@fossee.in>
parents: 3
diff changeset
     1
from django.shortcuts import render_to_response, redirect
44
69d1c4b99503 fixed a typo
Nishanth Amuluru <nishanth@fossee.in>
parents: 38
diff changeset
     2
from django.http import Http404
28
4dfcc826b241 Created a view for viewing profile
Nishanth Amuluru <nishanth@fossee.in>
parents: 3
diff changeset
     3
4dfcc826b241 Created a view for viewing profile
Nishanth Amuluru <nishanth@fossee.in>
parents: 3
diff changeset
     4
from django.contrib.auth.decorators import login_required
31
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
     5
from django.core.context_processors import csrf
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
     6
from django.views.decorators.csrf import csrf_protect
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
     7
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
     8
from pytask.profile.forms import EditProfileForm
44
69d1c4b99503 fixed a typo
Nishanth Amuluru <nishanth@fossee.in>
parents: 38
diff changeset
     9
from pytask.profile.utils import get_notification
28
4dfcc826b241 Created a view for viewing profile
Nishanth Amuluru <nishanth@fossee.in>
parents: 3
diff changeset
    10
4dfcc826b241 Created a view for viewing profile
Nishanth Amuluru <nishanth@fossee.in>
parents: 3
diff changeset
    11
@login_required
4dfcc826b241 Created a view for viewing profile
Nishanth Amuluru <nishanth@fossee.in>
parents: 3
diff changeset
    12
def view_profile(request):
49
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
    13
    """ Display the profile information.
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
    14
    """
28
4dfcc826b241 Created a view for viewing profile
Nishanth Amuluru <nishanth@fossee.in>
parents: 3
diff changeset
    15
4dfcc826b241 Created a view for viewing profile
Nishanth Amuluru <nishanth@fossee.in>
parents: 3
diff changeset
    16
    user = request.user
4dfcc826b241 Created a view for viewing profile
Nishanth Amuluru <nishanth@fossee.in>
parents: 3
diff changeset
    17
    profile = user.get_profile()
4dfcc826b241 Created a view for viewing profile
Nishanth Amuluru <nishanth@fossee.in>
parents: 3
diff changeset
    18
4dfcc826b241 Created a view for viewing profile
Nishanth Amuluru <nishanth@fossee.in>
parents: 3
diff changeset
    19
    context = {"user": user,
4dfcc826b241 Created a view for viewing profile
Nishanth Amuluru <nishanth@fossee.in>
parents: 3
diff changeset
    20
               "profile": profile,
4dfcc826b241 Created a view for viewing profile
Nishanth Amuluru <nishanth@fossee.in>
parents: 3
diff changeset
    21
              }
29
b1245d75938d Added template for viewing profile
Nishanth Amuluru <nishanth@fossee.in>
parents: 28
diff changeset
    22
    return render_to_response("profile/view.html", context)
31
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    23
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    24
@login_required
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    25
def edit_profile(request):
49
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
    26
    """ Make only a few fields editable.
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
    27
    """
31
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    28
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    29
    user = request.user
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    30
    profile = user.get_profile()
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    31
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    32
    context = {"user": user,
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    33
               "profile": profile,
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    34
              }
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    35
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    36
    context.update(csrf(request))
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    37
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    38
    if request.method == "POST":
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    39
        form = EditProfileForm(request.POST, instance=profile)
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    40
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    41
        if form.is_valid():
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    42
            form.save()
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    43
            return redirect("/accounts/profile/view")
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    44
        else:
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    45
            context.update({"form":form})
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    46
            return render_to_response("profile/edit.html", context)
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    47
    else:
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    48
        form = EditProfileForm(instance=profile)
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    49
        context.update({"form":form})
dde894b36370 created view for editing profile and created corresponding template
Nishanth Amuluru <nishanth@fossee.in>
parents: 29
diff changeset
    50
        return render_to_response("profile/edit.html", context)
35
8318df7e2d52 created a view for browising thro notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 31
diff changeset
    51
8318df7e2d52 created a view for browising thro notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 31
diff changeset
    52
@login_required
8318df7e2d52 created a view for browising thro notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 31
diff changeset
    53
def browse_notifications(request):
8318df7e2d52 created a view for browising thro notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 31
diff changeset
    54
    """ get the list of notifications that are not deleted and display in
8318df7e2d52 created a view for browising thro notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 31
diff changeset
    55
    datetime order."""
8318df7e2d52 created a view for browising thro notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 31
diff changeset
    56
37
c701e68f8d35 fixed a typo and browse notifications works fine
Nishanth Amuluru <nishanth@fossee.in>
parents: 36
diff changeset
    57
    user = request.user
35
8318df7e2d52 created a view for browising thro notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 31
diff changeset
    58
8318df7e2d52 created a view for browising thro notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 31
diff changeset
    59
    active_notifications = user.notification_sent_to.filter(is_deleted=False).order_by('sent_date').reverse()
8318df7e2d52 created a view for browising thro notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 31
diff changeset
    60
8318df7e2d52 created a view for browising thro notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 31
diff changeset
    61
    context = {'user':user,
8318df7e2d52 created a view for browising thro notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 31
diff changeset
    62
               'notifications':active_notifications,
8318df7e2d52 created a view for browising thro notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 31
diff changeset
    63
              }                               
36
5cd56898033c created template for browse notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 35
diff changeset
    64
35
8318df7e2d52 created a view for browising thro notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 31
diff changeset
    65
    return render_to_response('profile/browse_notifications.html', context)
38
c8c47fcb46f0 created a view for view notification and included the url. made changes accordingly in browse notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 37
diff changeset
    66
c8c47fcb46f0 created a view for view notification and included the url. made changes accordingly in browse notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 37
diff changeset
    67
@login_required
c8c47fcb46f0 created a view for view notification and included the url. made changes accordingly in browse notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 37
diff changeset
    68
def view_notification(request, nid):
c8c47fcb46f0 created a view for view notification and included the url. made changes accordingly in browse notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 37
diff changeset
    69
    """ get the notification depending on nid.
c8c47fcb46f0 created a view for view notification and included the url. made changes accordingly in browse notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 37
diff changeset
    70
    Display it.
c8c47fcb46f0 created a view for view notification and included the url. made changes accordingly in browse notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 37
diff changeset
    71
    """
c8c47fcb46f0 created a view for view notification and included the url. made changes accordingly in browse notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 37
diff changeset
    72
44
69d1c4b99503 fixed a typo
Nishanth Amuluru <nishanth@fossee.in>
parents: 38
diff changeset
    73
    user = request.user
69d1c4b99503 fixed a typo
Nishanth Amuluru <nishanth@fossee.in>
parents: 38
diff changeset
    74
    newest, newer, notification, older, oldest = get_notification(nid, user)
38
c8c47fcb46f0 created a view for view notification and included the url. made changes accordingly in browse notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 37
diff changeset
    75
c8c47fcb46f0 created a view for view notification and included the url. made changes accordingly in browse notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 37
diff changeset
    76
    if not notification:
c8c47fcb46f0 created a view for view notification and included the url. made changes accordingly in browse notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 37
diff changeset
    77
        raise Http404
c8c47fcb46f0 created a view for view notification and included the url. made changes accordingly in browse notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 37
diff changeset
    78
c8c47fcb46f0 created a view for view notification and included the url. made changes accordingly in browse notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 37
diff changeset
    79
    notification.is_read = True
c8c47fcb46f0 created a view for view notification and included the url. made changes accordingly in browse notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 37
diff changeset
    80
    notification.save()
c8c47fcb46f0 created a view for view notification and included the url. made changes accordingly in browse notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 37
diff changeset
    81
c8c47fcb46f0 created a view for view notification and included the url. made changes accordingly in browse notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 37
diff changeset
    82
    context = {'user':user,
c8c47fcb46f0 created a view for view notification and included the url. made changes accordingly in browse notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 37
diff changeset
    83
               'notification':notification,
c8c47fcb46f0 created a view for view notification and included the url. made changes accordingly in browse notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 37
diff changeset
    84
               'newest':newest,
c8c47fcb46f0 created a view for view notification and included the url. made changes accordingly in browse notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 37
diff changeset
    85
               'newer':newer,
c8c47fcb46f0 created a view for view notification and included the url. made changes accordingly in browse notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 37
diff changeset
    86
               'older':older,
c8c47fcb46f0 created a view for view notification and included the url. made changes accordingly in browse notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 37
diff changeset
    87
               'oldest':oldest,
c8c47fcb46f0 created a view for view notification and included the url. made changes accordingly in browse notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 37
diff changeset
    88
              }
c8c47fcb46f0 created a view for view notification and included the url. made changes accordingly in browse notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 37
diff changeset
    89
c8c47fcb46f0 created a view for view notification and included the url. made changes accordingly in browse notifications
Nishanth Amuluru <nishanth@fossee.in>
parents: 37
diff changeset
    90
    return render_to_response('profile/view_notification.html', context)
49
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
    91
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
    92
@login_required
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
    93
def delete_notification(request, nid):
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
    94
    """ check if the user owns the notification and delete it.
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
    95
    """
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
    96
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
    97
    user = request.user
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
    98
    newest, newer, notification, older, oldest = get_notification(nid, user)
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
    99
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   100
    if not notification:
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   101
        raise Http404
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   102
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   103
    notification.is_deleted = True
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   104
    notification.save()
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   105
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   106
    context = {'user':user,
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   107
               'notification':notification,
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   108
               'newest':newest,
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   109
               'newer':newer,
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   110
               'older':older,
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   111
               'oldest':oldest,
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   112
              }
50
869a9ab7e2df fixed few typos
Nishanth Amuluru <nishanth@fossee.in>
parents: 49
diff changeset
   113
869a9ab7e2df fixed few typos
Nishanth Amuluru <nishanth@fossee.in>
parents: 49
diff changeset
   114
    if older:
869a9ab7e2df fixed few typos
Nishanth Amuluru <nishanth@fossee.in>
parents: 49
diff changeset
   115
        redirect_url = "/profile/notf/view/nid=%s"%older.uniq_key
869a9ab7e2df fixed few typos
Nishanth Amuluru <nishanth@fossee.in>
parents: 49
diff changeset
   116
    else:
869a9ab7e2df fixed few typos
Nishanth Amuluru <nishanth@fossee.in>
parents: 49
diff changeset
   117
        redirect_url = "/profile/notf/browse"
49
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   118
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   119
    return redirect(redirect_url)
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   120
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   121
@login_required
50
869a9ab7e2df fixed few typos
Nishanth Amuluru <nishanth@fossee.in>
parents: 49
diff changeset
   122
def unread_notification(request, nid):
49
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   123
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   124
    """ check if the user owns the notification and delete it.
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   125
    """
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   126
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   127
    user = request.user
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   128
    newest, newer, notification, older, oldest = get_notification(nid, user)
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   129
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   130
    if not notification:
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   131
        raise Http404
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   132
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   133
    notification.is_read = False
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   134
    notification.save()
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   135
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   136
    context = {'user':user,
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   137
               'notification':notification,
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   138
               'newest':newest,
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   139
               'newer':newer,
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   140
               'older':older,
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   141
               'oldest':oldest,
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   142
              }
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   143
50
869a9ab7e2df fixed few typos
Nishanth Amuluru <nishanth@fossee.in>
parents: 49
diff changeset
   144
    if older:
869a9ab7e2df fixed few typos
Nishanth Amuluru <nishanth@fossee.in>
parents: 49
diff changeset
   145
        redirect_url = "/profile/notf/view/nid=%s"%older.uniq_key
869a9ab7e2df fixed few typos
Nishanth Amuluru <nishanth@fossee.in>
parents: 49
diff changeset
   146
    else:
869a9ab7e2df fixed few typos
Nishanth Amuluru <nishanth@fossee.in>
parents: 49
diff changeset
   147
        redirect_url = "/profile/notf/browse"
49
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   148
d24b4a7147d2 created views for delete and unread notification
Nishanth Amuluru <nishanth@fossee.in>
parents: 44
diff changeset
   149
    return redirect(redirect_url)