daily pastebin goal
16%
SHARE
TWEET

Untitled

meoooh Dec 25th, 2012 7 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class PasswordModificationForm(forms.Form):
  2.     currentPassword = forms.CharField(
  3.             label='현재 비밀번호',
  4.             widget=forms.PasswordInput(),
  5.             )  
  6.     newPassword1 = forms.CharField(
  7.             label='새로운 비밀번호',
  8.             widget=forms.PasswordInput(),
  9.             required=False,
  10.             )
  11.     newPassword2 = forms.CharField(
  12.             label='새로운 비밀번호(확인용)',
  13.             widget=forms.PasswordInput(),
  14.             required=False,
  15.             )
  16.  
  17.     def __init__(self, user, *args):
  18.         self.user = user
  19.         PasswordModificationForm().__init__(*args)
  20.  
  21. #   def clean_currentPassword(self):
  22.  
  23.  
  24.     def clean_newPassword2(self):
  25.         if 'newPassword1' in self.cleaned_data:
  26.             newPassword1 = self.cleaned_data['newPassword1']
  27.             newPassword2 = self.cleaned_data['newPassword2']
  28.             if newPassword1 == newPassword2:
  29.                 return newPassword2
  30.             elif newPassword1 != newPassword2:
  31.                 raise forms.ValidationError('새로운 비밀번호가 일치하지 않습니다.')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top