示例#1
0
 def save(self, commit=True):
     user = super(SRPUserCreationForm, self).save(commit=False)
     user.password = UNUSABLE_PASSWORD
     srpinfo = SRPUserInfo()
     srpinfo.verifier = self.cleaned_data['verifier']
     srpinfo.salt = self.cleaned_data['salt']
     srpinfo.srp_group = self.cleaned_data['srp_group']
     if commit:
         user.save()
         srpinfo.user = user
         srpinfo.save()
     return user
示例#2
0
文件: forms.py 项目: sqs/safebook
 def save(self, commit=True):
     user = super(SRPUserCreationForm, self).save(commit=False)
     user.password = UNUSABLE_PASSWORD
     srpinfo = SRPUserInfo()
     srpinfo.verifier = self.cleaned_data["verifier"]
     srpinfo.salt = self.cleaned_data["salt"]
     srpinfo.srp_group = self.cleaned_data["srp_group"]
     if commit:
         user.save()
         srpinfo.user = user
         srpinfo.save()
     return user