1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-07-18 09:12:55 +00:00
seahub/profile/forms.py

16 lines
474 B
Python
Raw Normal View History

2012-06-21 12:53:13 +00:00
# encoding: utf-8
from django import forms
2012-06-21 12:53:13 +00:00
from seahub.utils import validate_group_name
2012-06-21 12:53:13 +00:00
class ProfileForm(forms.Form):
nickname = forms.CharField(max_length=64)
intro = forms.CharField(max_length=256)
2012-06-21 12:53:13 +00:00
def clean_nickname(self):
nickname = self.cleaned_data['nickname']
if validate_group_name(nickname):
return nickname
else:
raise forms.ValidationError(u'昵称只能包含中英文字符、数字及下划线')