feat(accounts): 实现用户资料与认证页面
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
"""用户资料表单。"""
|
||||
|
||||
from django import forms
|
||||
|
||||
from .models import UserProfile
|
||||
|
||||
TIMEZONE_CHOICES = [("Asia/Shanghai", "中国标准时间(上海)")]
|
||||
|
||||
|
||||
class UserProfileForm(forms.ModelForm):
|
||||
"""只暴露第一阶段允许用户自行修改的资料字段。"""
|
||||
|
||||
timezone = forms.ChoiceField(label="时区", choices=TIMEZONE_CHOICES)
|
||||
|
||||
class Meta:
|
||||
model = UserProfile
|
||||
fields = ("display_name", "timezone")
|
||||
Reference in New Issue
Block a user