from django.shortcuts import render, redirect
from django.conf import settings
from django.http import HttpResponseRedirect
from django.views import View
from members.programmes import DEGREE_PROGRAMME_CHOICES
from registration.forms import RegistrationForm
from registration.models import LimboMember


class BaseView(View):
    context = {'DEBUG': settings.DEBUG}


class HomeView(BaseView):
    template = 'registration.html'

    def get(self, request):
        self.context['programmes'] = DEGREE_PROGRAMME_CHOICES
        self.context['form'] = RegistrationForm()
        return render(request, self.template, self.context)


class SubmitView(BaseView):
    template = 'submit.view'

    """
    def get(self, request):
        applicant = LimboMember()
    """

    def post(self, request):
        # TODO: add context
        form = RegistrationForm(request.POST)
        if form.is_valid():
            registration = form.instance
            registration.save()
        else:
            self.context['form'] = form
            return render(request, 'registration.html', self.context, status=400)

        render(request, 'submit.html')

@@ -680,92 +680,13 @@
 mit.
-view'%0A%0A    %22%22%22%0A    def get(self, request):%0A        applicant = LimboMember()%0A    %22%22%22
+html'
 %0A%0A  
@@ -716,36 +716,8 @@
 t):%0A
-        # TODO: add context%0A
     
@@ -786,16 +786,96 @@
 alid():%0A
+            # TODO: send mail to user as affirmation (check %60api/mailutils.py%60)%0A
         
@@ -1028,35 +1028,33 @@
 equest, 
-'registration.html'
+HomeView.template
 , self.c
@@ -1082,16 +1082,23 @@
         
+return 
 render(r
@@ -1105,23 +1105,37 @@
 equest, 
-'submit.html'
+self.template, self.context
 )%0A

Fix submit view in registration