Exemplo n.º 1
0
def getbalance(request):
    if 'address' not in request.session:
        return 'error'

    usr = FaucetUser.find_by_address(request.session['address'])
    if usr is None:
        return 'error'

    return usr.balance
Exemplo n.º 2
0
def getbalance(request):
    if 'address' not in request.session:
        return 'error'

    usr = FaucetUser.find_by_address(request.session['address'])
    if usr is None:
        return 'error'

    return usr.balance
Exemplo n.º 3
0
    def form_valid(self, form):
        addr = form.cleaned_data['address']
        email = form.cleaned_data['email']

        remember_me = form.cleaned_data['remember_me']
        if remember_me:
            self.request.session.set_expiry(None)
        else:
            self.request.session.set_expiry(0)

        usr = FaucetUser(address=addr, email=email, email_confirmed=False)
        usr.save()
        usr.send_reg_confirm_mail()

        messages.info(self.request, ACCOUNT_CONFIRMATION_SENT)
        self.request.session['address'] = addr

        return super(RegisterView, self).form_valid(form)
Exemplo n.º 4
0
    def form_valid(self, form):
        addr = form.cleaned_data['address']
        email = form.cleaned_data['email']

        remember_me = form.cleaned_data['remember_me']
        if remember_me:
            self.request.session.set_expiry(None)
        else:
            self.request.session.set_expiry(0)

        usr = FaucetUser(address=addr, email=email, email_confirmed=False)
        usr.save()
        usr.send_reg_confirm_mail()

        messages.info(self.request, ACCOUNT_CONFIRMATION_SENT)
        self.request.session['address'] = addr

        return super(RegisterView, self).form_valid(form)