simplePro 人员状态与超级用户状态 经常交替不可选

作者:xojisi 203 浏览 2 评论 发布时间:2020-04-09 09:18:42

models.py

from django.db import models
from django.contrib.auth.models import AbstractUser
# Create your models here.

class UserProfile(AbstractUser):
    department = models.IntegerField(default=0,verbose_name=u"部门",choices=((0,"信息部"),(1,"QC"),(2,"外包车间")))
    group = models.IntegerField(default=0,verbose_name=u"班组",choices=((0,"固体"),(1,"原辅料"),(2,"针剂"),(3,"公共介质"),(4,"后勤")), null=True,blank=True)
    is_director = models.BooleanField(default=False,verbose_name="是否主管")
    job_title = models.CharField(default='',max_length=20,verbose_name=u'岗位',null=True,blank=True)
    class Meta:
        verbose_name = "用户信息"
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.username
admin.py

from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from users.models import UserProfile

class UserProfileAdmin(UserAdmin):
    list_display = ['username','department','is_director','is_active','is_staff']

    list_display_links = ['username']
    readonly_fields = ['last_login','date_joined']

    fieldsets = (
        (None, {'fields': ('username', 'password','department','group','job_title',)}),

        ('权限与权限组', {'fields': ('is_director','is_active','is_staff','is_superuser','groups', 'user_permissions')}),

        ('重要时间', {'fields': ('last_login', 'date_joined')}),
    )


admin.site.register(UserProfile, UserProfileAdmin)

存在问题

SimplePro 人员状态或超级管理员无法选择,经常交替不可选

simpleUI 一直是正常的。

Loading...
评论列表 2条评论
xojisi
2020-05-04 18:14:55

https://streamja.com/OnBWo 我帖个视频。

xojisi
2020-05-04 18:14:55

准确来说是状态不稳定。 刷新页面后,有时可以选择,有时不可以选择。