daily pastebin goal
92%
SHARE
TWEET

Untitled

meoooh Dec 24th, 2012 9 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):
  18.         self.user = user
  19.    
  20. #   def clean_currentPassword(self):
  21.  
  22.  
  23.     def clean_newPassword2(self):
  24.         if 'newPassword1' in self.cleaned_data:
  25.             newPassword1 = self.cleaned_data['newPassword1']
  26.             newPassword2 = self.cleaned_data['newPassword2']
  27.             if newPassword1 == newPassword2:
  28.                 return newPassword2
  29.             elif newPassword1 != newPassword2:
  30.                 raise forms.ValidationError('
  31.                         새로운 비밀번호가 일치하지 않습니다.')
  32.     #   elif
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