def form_valid(self, form): ''' When valid. ''' e = EnrollAction.provide_signup( form.cleaned_data['group'] ) email=e.signup_email() #: normatli redirect #: return redirect(self.get_success_url()) return self.render_to_response(self.get_context_data(email=email,form=form))
def form_valid(self, form): ''' When valid. ''' e = EnrollAction.provide_signup(form.cleaned_data['group']) email = e.signup_email() #: normatli redirect #: return redirect(self.get_success_url()) return self.render_to_response( self.get_context_data(email=email, form=form))
def form_valid(self, form): ''' When valid. ''' if self.command == "commit": EnrollAction(self.request).enroll_by_web( form.cleaned_data['username'], form.cleaned_data['password'], form.cleaned_data['email'], form.cleaned_data['group'], ) #:return redirect(self.get_success_url()) return self.render_to_response(self.get_context_data(form=form))
def enroll(request, command, secret): result = "default" templates = "accounts/enroll/%s/%s.html" user = None error = None if command == "activate": enroll = EnrollAction(request).activate(secret) if enroll == None: result = "error" error = "invalid url to activate" user = enroll.mailbox.user else: result, error = "error", "command unknown" return render_to_response( templates % (command, result), { "user": user, "error": error }, context_instance=template.RequestContext(request), )
def enroll_by_mail(recipient, sender, journal_id, key): """ enroll by email """ print "Enroll by mail", recipient, sender, journal_id, key EnrollAction.enroll_by_mail(recipient, sender, journal_id, key)
def enroll_by_mail(recipient,sender,journal_id,key): """ enroll by email """ print "Enroll by mail",recipient,sender,journal_id,key EnrollAction.enroll_by_mail(recipient,sender,journal_id,key)