예제 #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