def challenge_challenge_accept_beneficiary_create_club(request, state): form = CreateTempClubForm() if request.method == 'POST': form = CreateTempClubForm(request.POST) if form.is_valid(): temp_club = _create_temp_club(form, state) return redirect('/challenges/challenge_challenge/beneficiary/%s/clubs/t/%s' % (state, temp_club.id)) template_data = { 'form': form, 'state': STATES[state]} return render( request, 'spudderspuds/challenges/pages/challenge_challenge_accept_beneficiary_create_club.html', template_data)
def challenge_challenge_accept_beneficiary_create_club(request, state): form = CreateTempClubForm() if request.method == 'POST': form = CreateTempClubForm(request.POST) if form.is_valid(): temp_club = _create_temp_club(form, state) return redirect( '/challenges/challenge_challenge/beneficiary/%s/clubs/t/%s' % (state, temp_club.id)) template_data = {'form': form, 'state': STATES[state]} return render( request, 'spudderspuds/challenges/pages/challenge_challenge_accept_beneficiary_create_club.html', template_data)
def create_challenge_choose_club_create_club(request, template_id, state): form = CreateTempClubForm() if request.method == 'POST': form = CreateTempClubForm(request.POST) if form.is_valid(): temp_club = _create_temp_club(form, state) return redirect('/challenges/create/%s/%s/t/%s' % (template_id, state, temp_club.id)) template_data = { 'form': form, 'state': STATES[state], 'template': get_object_or_404(ChallengeTemplate, id=template_id)} return render( request, 'spudderspuds/challenges/pages/create_challenge_choose_club_create_club.html', template_data)
def create_challenge_choose_club_create_club(request, template_id, state): form = CreateTempClubForm() if request.method == 'POST': form = CreateTempClubForm(request.POST) if form.is_valid(): temp_club = _create_temp_club(form, state) return redirect('/challenges/create/%s/%s/t/%s' % (template_id, state, temp_club.id)) template_data = { 'form': form, 'state': STATES[state], 'template': get_object_or_404(ChallengeTemplate, id=template_id) } return render( request, 'spudderspuds/challenges/pages/create_challenge_choose_club_create_club.html', template_data)
def challenge_accept_beneficiary_create_club(request, participation_id, state): participation = get_object_or_404(ChallengeParticipation, id=participation_id) challenge = participation.challenge template = challenge.template form = CreateTempClubForm() if request.method == 'POST': form = CreateTempClubForm(request.POST) if form.is_valid(): temp_club = _create_temp_club(form, state) return redirect('/challenges/%s/beneficiary/%s/t/%s' % (participation_id, state, temp_club.id)) template_data = { 'form': form, 'state': STATES[state], 'template': template} return render( request, 'spudderspuds/challenges/pages/challenge_accept_beneficiary_create_club.html', template_data)
def challenge_accept_beneficiary_create_club(request, participation_id, state): participation = get_object_or_404(ChallengeParticipation, id=participation_id) challenge = participation.challenge template = challenge.template form = CreateTempClubForm() if request.method == 'POST': form = CreateTempClubForm(request.POST) if form.is_valid(): temp_club = _create_temp_club(form, state) return redirect('/challenges/%s/beneficiary/%s/t/%s' % (participation_id, state, temp_club.id)) template_data = { 'form': form, 'state': STATES[state], 'template': template } return render( request, 'spudderspuds/challenges/pages/challenge_accept_beneficiary_create_club.html', template_data)