Commits

offline committed 7aec589

openid registration now dynamicly add fields specified in OPENID_EXTRA_FIELDS and OPENID_PROFILE_MAPPING

  • Participants
  • Parent commits 1c7ad0a

Comments (0)

Files changed (1)

openauth/forms.py

 
 
 class OpenIDRegistrationForm(forms.Form):
-    login = forms.CharField()
+    def __init__(self, *args, **kwargs):
+        for key, value in openauth.settings.OPENID_PROFILE_MAPPING.items():
+            self.base_fields[value] = forms.CharField()
+            if value == 'email':
+                self.base_fields[value] = forms.EmailField()
+        super(OpenIDRegistrationForm, self).__init__(*args, **kwargs)
 
     def clean_login(self):
         login = self.cleaned_data['login']