def provide_invite(self,group,inviter, viewname="paloma_enroll",absolute=lambda x:x): ''' Invite ''' ret = Enroll(group=group,inviter=inviter) ret.enroll_type = "invite" ret.dt_expire=now() + timedelta(minutes=3) #:TODO ret.url = self.absolute( reverse(viewname, kwargs={"command":"invite","secret": ret.secret,}) ) ret.save() return ret
def provide_signup(self, group): ''' Sign Up ''' ret = Enroll(group=group) #:Newly created ret.enroll_type = "signup" ret.dt_expire = now() + timedelta(minutes=3) #:TODO ret.save() #:Emai Task et = EmailTask(email=ret.signup_email(), task_module="paloma.tasks", task_name="enroll_by_mail", task_key=str(ret.id), dt_expire=now() + timedelta(minutes=3)) et.save() return ret
def provide_invite(self, group, inviter, viewname="paloma_enroll", absolute=lambda x: x): ''' Invite ''' ret = Enroll(group=group, inviter=inviter) ret.enroll_type = "invite" ret.dt_expire = now() + timedelta(minutes=3) #:TODO ret.url = self.absolute( reverse(viewname, kwargs={ "command": "invite", "secret": ret.secret, })) ret.save() return ret
def provide_signup(self,group): ''' Sign Up ''' ret = Enroll(group=group) #:Newly created ret.enroll_type = "signup" ret.dt_expire=now() + timedelta(minutes=3) #:TODO ret.save() #:Emai Task et = EmailTask(email =ret.signup_email(), task_module="paloma.tasks", task_name="enroll_by_mail", task_key = str(ret.id), dt_expire = now() + timedelta(minutes=3) ) et.save() return ret
def provide_signin(self,mailbox,group, viewname="paloma_enroll"): ''' Password reset or.. :param mailbox: Mailbox model instance ''' try: ret = mailbox.enroll except: ret = Enroll(mailbox=mailbox,group=group) ret.enroll_type = "signin" ret.secret = create_auto_secret() ret.url = self.absolute( reverse(viewname, kwargs={"command":"signin","secret": ret.secret,}) ) ret.dt_expire=now() + timedelta(minutes=3) #:TODO ret.save() return ret
def provide_activate(self,mailbox,group, viewname="paloma_enroll" ): ''' Activation :param mailbox: Mailbox model instance ''' try: ret = mailbox.enroll except: ret = Enroll(mailbox=mailbox,group=group) ret.enroll_type = "activate" ret.secret = create_auto_secret() ret.url = self.absolute( reverse(viewname, kwargs={"command":"activate","secret": ret.secret,}) ) print ret.url ret.dt_expire=now() + timedelta(minutes=3) #:TODO ret.save() return ret
def provide_signin(self, mailbox, group, viewname="paloma_enroll"): ''' Password reset or.. :param mailbox: Mailbox model instance ''' try: ret = mailbox.enroll except: ret = Enroll(mailbox=mailbox, group=group) ret.enroll_type = "signin" ret.secret = create_auto_secret() ret.url = self.absolute( reverse(viewname, kwargs={ "command": "signin", "secret": ret.secret, })) ret.dt_expire = now() + timedelta(minutes=3) #:TODO ret.save() return ret
def provide_activate(self, mailbox, group, viewname="paloma_enroll"): ''' Activation :param mailbox: Mailbox model instance ''' try: ret = mailbox.enroll except: ret = Enroll(mailbox=mailbox, group=group) ret.enroll_type = "activate" ret.secret = create_auto_secret() ret.url = self.absolute( reverse(viewname, kwargs={ "command": "activate", "secret": ret.secret, })) print ret.url ret.dt_expire = now() + timedelta(minutes=3) #:TODO ret.save() return ret