def __init__(self, *args, **kwargs): super(UserForm, self).__init__(*args, **kwargs) emails = get_all_user_mails(self.instance) self.fields['email'].choices = [(x, x) for x in sorted(emails)] self.fields['username'].valid = self.instance.username
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) emails = get_all_user_mails(self.instance.user) emails.add("") self.fields["public_email"].choices = [(x, x) for x in sorted(emails)] self.helper = FormHelper(self) self.helper.disable_csrf = True self.helper.form_tag = False
def __init__(self, *args, **kwargs): super(UserForm, self).__init__(*args, **kwargs) emails = get_all_user_mails(self.instance) self.fields['email'].choices = [(x, x) for x in sorted(emails)] self.fields['username'].valid = self.instance.username self.helper = FormHelper(self) self.helper.disable_csrf = True self.helper.form_tag = False