def setup(request): cred_count = AppCreds.objects.filter(user=request.user).count() ffu_count = FanFundingUpdate.objects.filter(user=request.user).count() if cred_count == 1 and ffu_count == 0: creds = AppCreds.objects.get(user=request.user) ffu = FanFundingUpdate(credentials=creds, type="fanfunding", user=request.user) ffu.save() return HttpResponseRedirect("/fanfunding/") CredsForm = creds_form(request.user) if request.POST: f = CredsForm(request.POST) if f.is_valid(): creds = f.cleaned_data['account'] ffu = FanFundingUpdate(credentials=creds, type="fanfunding", user=request.user) ffu.save() return HttpResponseRedirect("/fanfunding/") else: f = CredsForm() if cred_count == 0: return HttpResponseRedirect("/googleaccount/setup?redir=ffsetup") return render(request, "fanfunding/setup.html", { 'form': f, 'count': cred_count })
def setup(request): CredsForm = creds_form(request.user) if request.POST: f = CredsForm(request.POST) if f.is_valid(): creds = f.cleaned_data['account'] ffu = SponsorUpdate(credentials=creds, type="sponsors", user=request.user) ffu.save() return HttpResponseRedirect("/sponsors/") else: f = CredsForm() return render(request, "sponsors/setup.html", {'form': f})
def setup(request): CredsForm = creds_form(request.user) if request.POST: f = CredsForm(request.POST) if f.is_valid(): creds = f.cleaned_data['account'] ffu = SponsorUpdate(credentials=creds, last_update=datetime(1990,1,1,0,0,0), type="sponsors", user=request.user) ffu.save() return HttpResponseRedirect("/sponsors/") else: f = CredsForm() return render(request, "sponsors/setup.html", {'form': f})
def setup(request): CredsForm = creds_form(request.user) if request.POST: f = CredsForm(request.POST) if f.is_valid(): creds = f.cleaned_data['account'] ffu = FanFundingUpdate(credentials=creds, type="fanfunding", user=request.user) ffu.save() return HttpResponseRedirect("/fanfunding/") else: f = CredsForm() return render(request, "fanfunding/setup.html", {'form': f})
def setup(request): CredsForm = creds_form(request.user) if request.POST: f = CredsForm(request.POST) if f.is_valid(): creds = f.cleaned_data['account'] ffu = YoutubeSubUpdate(credentials=creds, type="youtubesubs", user=request.user) ffu.save() return HttpResponseRedirect("/youtubesubs/") else: f = CredsForm() return render(request, "youtubesubs/setup.html", {'form': f})
def setup(request): cred_count = AppCreds.objects.filter(user=request.user).count() ffu_count = YoutubeSubUpdate.objects.filter(user=request.user).count() if cred_count == 1 and ffu_count == 0: creds = AppCreds.objects.get(user=request.user) ffu = YoutubeSubUpdate(credentials=creds, type="youtubesubs", user=request.user) ffu.save() return HttpResponseRedirect("/youtubesubs/") CredsForm = creds_form(request.user) if request.POST: f = CredsForm(request.POST) if f.is_valid(): creds = f.cleaned_data['account'] ffu = YoutubeSubUpdate(credentials=creds, type="youtubesubs", user=request.user) ffu.save() return HttpResponseRedirect("/youtubesubs/") else: f = CredsForm() return render(request, "youtubesubs/setup.html", {'form': f})
def setup(request): cred_count = AppCreds.objects.filter(user=request.user).count() ffu_count = FanFundingUpdate.objects.filter(user=request.user).count() if cred_count == 1 and ffu_count == 0: creds = AppCreds.objects.get(user=request.user) ffu = FanFundingUpdate(credentials=creds, type="fanfunding", user=request.user) ffu.save() return HttpResponseRedirect("/fanfunding/") CredsForm = creds_form(request.user) if request.POST: f = CredsForm(request.POST) if f.is_valid(): creds = f.cleaned_data['account'] ffu = FanFundingUpdate(credentials=creds, type="fanfunding", user=request.user) ffu.save() return HttpResponseRedirect("/fanfunding/") else: f = CredsForm() if cred_count == 0: return HttpResponseRedirect("/googleaccount/setup?redir=ffsetup") return render(request, "fanfunding/setup.html", {'form': f, 'count': cred_count})