1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-10-21 19:00:12 +00:00
Files
seahub/profile/forms.py

16 lines
506 B
Python
Raw Normal View History

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