示例#1
0
文件: forms.py 项目: isagalaev/scipio
 def clean_autoupdate(self):
     if self.cleaned_data['autoupdate']:
         self.ext_data = utils.read_hcard(self.instance.openid)
         if not self.ext_data:
             raise forms.ValidationError(_('No readable profile data found on %s') % self.instance.openid)
     else:
         self.ext_data = None
     return self.cleaned_data['autoupdate']
示例#2
0
文件: forms.py 项目: adw0rd/scipio
 def clean_autoupdate(self):
     if self.cleaned_data['autoupdate']:
         self.ext_data = utils.read_hcard(self.instance.openid)
         if not self.ext_data:
             raise forms.ValidationError(_('No readable profile data found on %s') % self.instance.openid)
     else:
         self.ext_data = None
     return self.cleaned_data['autoupdate']
示例#3
0
 def update_profile(self):
     '''
     Reads profile info from HTTP page and updates profile.
     Currently just reads hCard.
     '''
     data = utils.read_hcard(self.openid)
     changes = {}
     if data:
         for key, value in data.items():
             old_value = getattr(self, key)
             if old_value != value:
                 setattr(self, key, value)
                 changes[key] = (old_value, value)
     return changes
示例#4
0
文件: models.py 项目: adw0rd/scipio
 def update_profile(self):
     '''
     Reads profile info from HTTP page and updates profile.
     Currently just reads hCard.
     '''
     data = utils.read_hcard(self.openid)
     changes = {}
     if data:
         for key, value in data.items():
             old_value = getattr(self, key)
             if old_value != value:
                 setattr(self, key, value)
                 changes[key] = (old_value, value)
     return changes