Esempio n. 1
0
 def post(self, request):
     form = MeetingRoomApplicationForm(request.POST)
     if not form.is_valid():
         return render(request, 'meeting_room/form.html', 
                       {'form': form,
                        'post_url': reverse('meeting_room:apply')})
     app = form.save(commit=False)
     app.organization = request.user.organization
     app.save()
     return HttpResponseRedirect(reverse('meeting_room:manage'))
Esempio n. 2
0
 def post(self, request):
     app_id = request.GET.get('id')
     app = get_object_or_404(MeetingRoomApplication, id=app_id)
     form = MeetingRoomApplicationForm(request.POST, instance=app)
     if not form.is_valid():
         return render(request, 'meeting_room/form.html', 
             {'form': form, 'app_id': app_id,
              'post_url': reverse('meeting_room:modify')+'?id='+app_id})
     form.save()
     return HttpResponseRedirect(reverse('meeting_room:manage'))
Esempio n. 3
0
 def post(self, request):
     form = MeetingRoomApplicationForm(request.POST)
     if not form.is_valid():
         return render(request, 'meeting_room/form.html', {
             'form': form,
             'post_url': reverse('meeting_room:apply')
         })
     app = form.save(commit=False)
     app.organization = request.user.organization
     app.save()
     return HttpResponseRedirect(reverse('meeting_room:manage'))
Esempio n. 4
0
 def post(self, request):
     app_id = request.GET.get('id')
     app = get_object_or_404(MeetingRoomApplication, id=app_id)
     form = MeetingRoomApplicationForm(request.POST, instance=app)
     if not form.is_valid():
         return render(
             request, 'meeting_room/form.html', {
                 'form': form,
                 'app_id': app_id,
                 'post_url':
                 reverse('meeting_room:modify') + '?id=' + app_id
             })
     form.save()
     return HttpResponseRedirect(reverse('meeting_room:manage'))
Esempio n. 5
0
 def get(self, request):
     app_id = request.GET.get('id')
     app = get_object_or_404(MeetingRoomApplication, id=app_id)
     form = MeetingRoomApplicationForm(instance=app)
     return render(
         request, 'meeting_room/form.html', {
             'form': form,
             'app_id': app_id,
             'post_url': reverse('meeting_room:modify') + '?id=' + app_id
         })
Esempio n. 6
0
 def get(self, request):
     return render(
         request, 'meeting_room/form.html', {
             'form': MeetingRoomApplicationForm(),
             'post_url': reverse('meeting_room:apply')
         })