1 # -*- coding: utf-8 -*-
2 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
3 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
5 from django.contrib.auth.decorators import permission_required
6 from django.core.urlresolvers import reverse
7 from django.http.response import HttpResponseRedirect
8 from django.shortcuts import render
10 from push.forms import NotificationForm
13 @permission_required('push.change_notification')
14 def notification_form(request):
15 if request.method == 'POST':
16 form = NotificationForm(data=request.POST, files=request.FILES or None)
19 return HttpResponseRedirect(reverse('notification_sent'))
21 form = NotificationForm()
22 return render(request, 'push/notification_form.html', {'form': form})
25 def notification_sent(request):
26 return render(request, 'push/notification_sent.html')