Exemplo n.º 1
0
    def get(self, request, *args, **kwargs):
        if settings.INVITE_MODE :
            invite_code = request.GET.get('code',None)
            if invite_code and is_code_valid(invite_code):
                request.session['invite_code'] = invite_code
                email = InvitationCode.objects.is_from_applicant(invite_code)
                if email:
                    request.session['invite_email'] = email
                return userena_signup(request)
            elif not settings.INVITE_ONLY:
                return userena_signup(request)
        else:
            return userena_signup(request)

        return HttpResponseRedirect(reverse('invitation_invite'))
Exemplo n.º 2
0
def signup(request):
    if request.method == 'POST':
        postal_form = PostalAddressForm(request.POST, prefix=_(u"Postal"))
        delivery_form = PostalAddressForm(request.POST, prefix=_(u"Delivery"))
    else:
        postal_form = PostalAddressForm(prefix=_(u"Postal"))
        delivery_form = PostalAddressForm(prefix=_(u"Delivery"))

    def signup_form(*args, **kw):
        return SignupForm(postal_form, delivery_form, *args, **kw)

    return userena_signup(request,
        signup_form=signup_form,
        template_name='signup.html',
        extra_context = {
            'postal_form': postal_form,
            'delivery_form': delivery_form}
    )
Exemplo n.º 3
0
def signup(request):
    if request.method == 'POST':
        postal_form = PostalAddressForm(request.POST, prefix=_(u"Postal"))
        delivery_form = PostalAddressForm(request.POST, prefix=_(u"Delivery"))
    else:
        postal_form = PostalAddressForm(prefix=_(u"Postal"))
        delivery_form = PostalAddressForm(prefix=_(u"Delivery"))

    def signup_form(*args, **kw):
        return SignupForm(postal_form, delivery_form, *args, **kw)

    return userena_signup(request,
                          signup_form=signup_form,
                          template_name='signup.html',
                          extra_context={
                              'postal_form': postal_form,
                              'delivery_form': delivery_form
                          })
Exemplo n.º 4
0
 def post(self, request, *args, **kwargs):
     return userena_signup(request)
Exemplo n.º 5
0
def signup(request):
    return userena_signup(request, signup_form=SignupFormTos,
                          template_name='userena/signup_form.html')
Exemplo n.º 6
0
def signup(request, **kwargs):
    response = userena_signup(request, **kwargs)
    if response.status_code == 302:
        messages.success(request, 'You have been signed up.')
    return response
Exemplo n.º 7
0
def register(request):
    return userena_signup(request,
                          template_name = 'profiles/register.html',
                          success_url = '/dashboard/')