def clean_app_id(self): if str(self.cleaned_data['app_id']) != str(get_app_id()): raise forms.ValidationError(u'app_id - от другого приложения') return self.cleaned_data['app_id']
def get_auth_key(self): api_id = get_app_id() viewer_id = self.cleaned_data['uid'] api_secret = get_app_secret() return md5(str(api_id) + str(viewer_id) + str(api_secret)).hexdigest()