コード例 #1
0
ファイル: views.py プロジェクト: ikkiran/aloha
def submit_details(request):
    """
        Get the secondary email address, phone number and save it to the Profile.
    """
    user = request.user
    category = user.get_profile().application.cgy #Getting the Category information
    #Flag set based on OBC Check
    if category == "B": cat_flag = True
    else: cat_flag = False  
    if request.method == "POST":
        form = UserDetailsForm(user, request.POST)
        if form.is_valid():
            data = form.cleaned_data
            form.save()
            return redirect('/allotter/apply/') #Details submitted, taken to application page
        else:
            return render(request, 'allotter/details.html', {'form':form})  
                
    else:
        form = UserDetailsForm(request.user)
        context = {"form": form, "cat_flag": cat_flag}
        return render(request, 'allotter/details.html', context)              
コード例 #2
0
ファイル: views.py プロジェクト: FOSSEE/aloha
def submit_details(request):
    """
        Get the secondary email address, phone number and save it to the Profile.
    """
    user = request.user
    #Checking whether user had done the allottment previously.
    user_profile = user.get_profile()
    user_application = user_profile.application
    if user_application.quit_status:
        return redirect('/allotter/complete/')
         
    if request.method == "POST":
        form = UserDetailsForm(user, request.POST)
        if form.is_valid():
            data = form.cleaned_data
            form.save()
            return redirect('/allotter/apply/') #Details submitted, taken to application page
        else:
            return render(request, 'allotter/details.html', {'form':form})  
                
    else:
        form = UserDetailsForm(request.user)
        context = {"form": form}
        return render(request, 'allotter/details.html', context)