Esempio n. 1
0
File: views.py Progetto: zxhx/seahub
def notification_add(request):
    if not request.user.is_staff or request.method != 'POST':
        raise Http404

    f = NotificationForm(request.POST)
    f.save()
    return HttpResponseRedirect(reverse('notification_list', args=[]))
Esempio n. 2
0
def notification_add(request):
    if not request.user.is_staff or request.method != 'POST':
        raise Http404

    f = NotificationForm(request.POST)
    f.save()
    return HttpResponseRedirect(reverse('notification_list', args=[]))
Esempio n. 3
0
def notification_add(request):
    if not request.user.is_staff:
        raise Http404
    if request.method == 'POST':
        f = NotificationForm(request.POST)
        f.save()
        return HttpResponseRedirect(reverse('notification_list', args=[]))
    else:
        form = NotificationForm()

    return render_to_response("notifications/add_notification_form.html", {
            'form': form,
            }, context_instance=RequestContext(request))
Esempio n. 4
0
def notification_add(request):
    if not request.user.is_staff:
        raise Http404
    if request.method == 'POST':
        f = NotificationForm(request.POST)
        f.save()
        return HttpResponseRedirect(reverse('notification_list', args=[]))
    else:
        form = NotificationForm()

    return render_to_response("notifications/add_notification_form.html", {
            'form': form,
            }, context_instance=RequestContext(request))