提交 9186e6e4 编写于 作者: P Pzqqt

wuliu: forms.py: ManageUsers: Sort departments by tree strings

上级 6ac55b27
......@@ -1249,7 +1249,7 @@ class ManageUsers(_FormBase):
administrator = forms.BooleanField(label="管理员", required=False, initial=False)
department = forms.ChoiceField(
label="所属部门",
choices=((dept.id, dept.tree_str) for dept in Department.objects.all()),
choices=sorted(((dept.id, dept.tree_str) for dept in Department.objects.all()), key=lambda x: x[1]),
)
def __init__(self, *args, **kwargs):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册