raj
unread,Aug 31, 2011, 12:05:50 AM8/31/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Hey guys, I'm trying to make a custom registration form for a custom
UserProfile class.
I have the following form:
class UserForm(ModelForm):
username = forms.EmailField(label = _("Email"), widget =
forms.TextInput(attrs ={ 'id':'email'}), required=True)
first_name = forms.CharField(widget = forms.TextInput(attrs =
{'id':'fname'}), required=True)
last_name = forms.CharField(widget = forms.TextInput(attrs =
{'id':'lname'}), required=True)
linked_id = forms.CharField(widget = forms.HiddenInput(attrs =
{'id':'linkedid'}))
password = forms.CharField(label=_('Password'),
widget=forms.PasswordInput(render_value = False), required = True)
password2 = forms.CharField(label=_('Re-Enter your password'), widget
= forms.PasswordInput(render_value = False))
email = forms.CharField(widget = forms.HiddenInput(), required =
False)
class Meta:
model = UserProfile
fields = ('username', 'first_name', 'last_name', 'linked_id',
'password', 'email', )
def clean_password2(self):
password1 = self.cleaned_data.get("password", "")
password2 = self.cleaned_data['password2']
if password1 != password2:
raise forms.ValidationError(_("The passwords you entered did not
match!"))
return password2
def clean_email(self):
email = self.cleaned_data['username']
return email
The issue that I'm having is that when the password is entered, and
saved, its not being encrypted. So I can just view a users password in
my admin panel...
How do I get the passwords to be encrypted? I had another website and
it worked then, but when I'm trying it now, it just isn't working.
Help please. Thank you.