def beta_invitations(request): if request.method == 'POST': form = forms.InvitationForm(data=request.POST) if form.is_valid(): new_invitation = BetaInvitation() new_invitation.assigned_customer = form.cleaned_data[ 'requesting_customer'] new_invitation.forced_package = Package.objects.get( code=FORCED_PACKAGE_CODE) new_invitation.save() new_invitation.password = generate_onetimepass(new_invitation.id) new_invitation.save() return HttpResponseRedirect(reverse('beta_invitations')) else: form = forms.InvitationForm() invitations = BetaInvitation.objects.all().order_by('-invitation_date') context = { 'invitations': invitations, 'form': form, } return render_to_response('beta_invitations.html', Context(context, request))
def beta_request_invite(request, request_id=None): beta_request = BetaTestRequest.objects.get(id=request_id) new_invitation = BetaInvitation() new_invitation.beta_requester = beta_request new_invitation.forced_package = Package.objects.get(code=FORCED_PACKAGE_CODE) new_invitation.save() new_invitation.password = generate_onetimepass(new_invitation.id) new_invitation.save() return HttpResponseRedirect(reverse('beta_requests'));
def beta_request_invite(request, request_id=None): beta_request = BetaTestRequest.objects.get(id=request_id) new_invitation = BetaInvitation() new_invitation.beta_requester = beta_request new_invitation.forced_package = Package.objects.get( code=FORCED_PACKAGE_CODE) new_invitation.save() new_invitation.password = generate_onetimepass(new_invitation.id) new_invitation.save() return HttpResponseRedirect(reverse('beta_requests'))
def beta_invitations(request): if request.method == 'POST': form = forms.InvitationForm(data=request.POST) if form.is_valid(): new_invitation = BetaInvitation() new_invitation.assigned_customer = form.cleaned_data['requesting_customer'] new_invitation.forced_package = Package.objects.get(code=FORCED_PACKAGE_CODE) new_invitation.save() new_invitation.password = generate_onetimepass(new_invitation.id) new_invitation.save() return HttpResponseRedirect(reverse('beta_invitations')); else: form = forms.InvitationForm() invitations = BetaInvitation.objects.all().order_by('-invitation_date') context = { 'invitations': invitations, 'form': form, } return render_to_response('beta_invitations.html', Context(context, request))