Beispiel #1
0
 def post(self, request):
     form = StudentActivityCenterApplicationForm(request.POST)
     if not form.is_valid():
         return render(request, 'student_activity_center/apply.html',
                       {'form': form})
     app = form.save(commit=False)
     app.organization = request.user.organization
     app.save()
     return HttpResponseRedirect(reverse('home'))
Beispiel #2
0
 def post(self, request):
     app_id = request.GET.get('id')
     app = get_object_or_404(StudentActivityCenterApplication, id=app_id)
     form = StudentActivityCenterApplicationForm(
             request.POST, request.FILES, instance=app)
     if not form.is_valid():
         return render(request, 'student_activity_center/form.html', 
             {'form': form, 'app_id': app_id,
              'post_url': \
                  reverse('student_activity_center:modify')+'?id='+app_id})
     form.save()
     return HttpResponseRedirect(reverse('student_activity_center:manage'))
Beispiel #3
0
 def post(self, request):
     form = StudentActivityCenterApplicationForm(request.POST,
                                                 request.FILES)
     if not form.is_valid():
         return render(request, 'student_activity_center/form.html', {
             'form': form,
             'post_url': reverse('student_activity_center:apply')
         })
     app = form.save(commit=False)
     app.organization = request.user.organization
     app.save()
     return HttpResponseRedirect(reverse('student_activity_center:manage'))
Beispiel #4
0
 def post(self, request):
     app_id = request.GET.get('id')
     app = get_object_or_404(StudentActivityCenterApplication, id=app_id)
     form = StudentActivityCenterApplicationForm(request.POST,
                                                 request.FILES,
                                                 instance=app)
     if not form.is_valid():
         return render(request, 'student_activity_center/form.html',
             {'form': form, 'app_id': app_id,
              'post_url': \
                  reverse('student_activity_center:modify')+'?id='+app_id})
     form.save()
     return HttpResponseRedirect(reverse('student_activity_center:manage'))