Explorar el Código

新增用户管理(南京质检院)

刘凡 hace 2 años
padre
commit
ac21b638a8
Se han modificado 100 ficheros con 1507 adiciones y 51 borrados
  1. 2 1
      .idea/vcs.xml
  2. 1 1
      Config/database_mysql.cnf
  3. 3 1
      TestLaboratory/settings.py
  4. 2 1
      TestLaboratory/urls.py
  5. 0 0
      apps/group/__init__.py
  6. 3 0
      apps/group/admin.py
  7. 6 0
      apps/group/apps.py
  8. 31 0
      apps/group/migrations/0001_initial.py
  9. 19 0
      apps/group/migrations/0002_group_users.py
  10. 18 0
      apps/group/migrations/0003_alter_group_code.py
  11. 0 0
      apps/group/migrations/__init__.py
  12. 25 0
      apps/group/models.py
  13. 3 0
      apps/group/tests.py
  14. 11 0
      apps/group/urls.py
  15. 3 0
      apps/group/views.py
  16. 0 0
      apps/group/views/__init__.py
  17. 93 0
      apps/group/views/grouplistview.py
  18. 46 0
      apps/group/views/groupuserview.py
  19. 57 0
      apps/group/views/groupview.py
  20. 1 0
      apps/plan/views/planview.py
  21. 23 0
      apps/software/migrations/0003_auto_20221004_2044.py
  22. 2 2
      apps/software/models.py
  23. 18 0
      apps/task/migrations/0004_alter_testcase_id.py
  24. 1 1
      apps/task/models.py
  25. 17 0
      apps/user/migrations/0003_remove_user_group.py
  26. 1 1
      apps/user/models.py
  27. 7 0
      apps/user/urls.py
  28. 47 0
      apps/user/views/userexportview.py
  29. 36 0
      apps/user/views/userjoinview.py
  30. 10 27
      apps/user/views/userlistview.py
  31. 36 0
      apps/user/views/userquitview.py
  32. 6 6
      apps/user/views/userview.py
  33. BIN
      db/permission.xlsx
  34. BIN
      db/role_permissions.xlsx
  35. BIN
      db/software.xlsx
  36. BIN
      lims-frontend/dist-recheck.zip
  37. 1 1
      lims-frontend/dist/browserconfig.xml
  38. 1 1
      lims-frontend/dist/css/chunk-0281b3aa.9b88a26e.css
  39. 1 0
      lims-frontend/dist/css/chunk-10d2afba.ce57d308.css
  40. 0 0
      lims-frontend/dist/css/chunk-16c48c2e.7fc2d857.css
  41. 0 1
      lims-frontend/dist/css/chunk-229e8b0d.c6a60be1.css
  42. 1 1
      lims-frontend/dist/css/chunk-241ed1ca.ebb262cf.css
  43. 1 0
      lims-frontend/dist/css/chunk-32c93460.7d1c1019.css
  44. 1 0
      lims-frontend/dist/css/chunk-3fa938b0.67c1abc3.css
  45. 0 1
      lims-frontend/dist/css/chunk-4d04fe3e.84a27482.css
  46. 0 1
      lims-frontend/dist/css/chunk-50b41631.fd18f11f.css
  47. 1 0
      lims-frontend/dist/css/chunk-690a2502.516a67e1.css
  48. 1 0
      lims-frontend/dist/css/chunk-6dff90aa.0594504e.css
  49. 0 1
      lims-frontend/dist/css/chunk-719f2106.b52eb0d9.css
  50. 1 1
      lims-frontend/dist/css/chunk-7f50406f.42fd3f6b.css
  51. 0 1
      lims-frontend/dist/css/chunk-8e31973a.873c8817.css
  52. 1 0
      lims-frontend/dist/css/chunk-fd7a9eb6.3a5a8038.css
  53. 1 1
      lims-frontend/dist/index.html
  54. 0 0
      lims-frontend/dist/js/app.8c71c862.js
  55. 0 0
      lims-frontend/dist/js/app.d810249c.js
  56. 0 0
      lims-frontend/dist/js/chunk-0281b3aa.3123ee64.js
  57. 0 0
      lims-frontend/dist/js/chunk-10d2afba.7c41cba7.js
  58. 0 0
      lims-frontend/dist/js/chunk-140ff0e2.05dba521.js
  59. 0 0
      lims-frontend/dist/js/chunk-16c48c2e.f5a39a80.js
  60. 0 0
      lims-frontend/dist/js/chunk-1acc34dc.b58dc71a.js
  61. 0 0
      lims-frontend/dist/js/chunk-229e8b0d.75c2772c.js
  62. 0 0
      lims-frontend/dist/js/chunk-241ed1ca.8103bcd5.js
  63. 0 0
      lims-frontend/dist/js/chunk-28e0a0ac.3420e88c.js
  64. 0 0
      lims-frontend/dist/js/chunk-2c8f5038.0ba3baea.js
  65. 0 0
      lims-frontend/dist/js/chunk-2c8f5038.513dbbc6.js
  66. 0 0
      lims-frontend/dist/js/chunk-2f551c08.5d77341a.js
  67. 0 0
      lims-frontend/dist/js/chunk-32c93460.dae9287a.js
  68. 0 0
      lims-frontend/dist/js/chunk-3b2a3e5a.b0f060aa.js
  69. 0 0
      lims-frontend/dist/js/chunk-3b2a3e5a.b9e9767f.js
  70. 0 0
      lims-frontend/dist/js/chunk-3fa938b0.1debc69f.js
  71. 0 0
      lims-frontend/dist/js/chunk-42ba316b.809a0c1d.js
  72. 0 0
      lims-frontend/dist/js/chunk-457fc716.375dffe8.js
  73. 0 0
      lims-frontend/dist/js/chunk-48594924.2f8c9f8d.js
  74. 0 0
      lims-frontend/dist/js/chunk-48594924.ad0beba2.js
  75. 0 0
      lims-frontend/dist/js/chunk-4d04fe3e.96858567.js
  76. 0 0
      lims-frontend/dist/js/chunk-50b41631.efae28c2.js
  77. 0 0
      lims-frontend/dist/js/chunk-61ad3c7e.211bd7a7.js
  78. 0 0
      lims-frontend/dist/js/chunk-61ad3c7e.8f2fe99b.js
  79. 0 0
      lims-frontend/dist/js/chunk-690a2502.666b5816.js
  80. 0 0
      lims-frontend/dist/js/chunk-6d88c632.295cce00.js
  81. 0 0
      lims-frontend/dist/js/chunk-6d88c632.970e4c1a.js
  82. 0 0
      lims-frontend/dist/js/chunk-6dff90aa.798f9911.js
  83. 0 0
      lims-frontend/dist/js/chunk-6fb66e82.04521d53.js
  84. 0 0
      lims-frontend/dist/js/chunk-6fb66e82.d4cc4725.js
  85. 0 0
      lims-frontend/dist/js/chunk-719f2106.86baecc1.js
  86. 0 0
      lims-frontend/dist/js/chunk-7f50406f.ef617aba.js
  87. 0 0
      lims-frontend/dist/js/chunk-8e31973a.dfc97e88.js
  88. 0 0
      lims-frontend/dist/js/chunk-b371d0a0.1f329c3b.js
  89. 0 0
      lims-frontend/dist/js/chunk-fd7a9eb6.156d0b8e.js
  90. BIN
      lims-frontend/dist/logo.png
  91. BIN
      lims-frontend/dist/logo2.png
  92. 14 0
      logs/all-2022-10-04.log
  93. 74 0
      logs/all-2022-10-05.log
  94. 553 0
      logs/all-2022-10-06.log
  95. 103 0
      logs/all-2022-10-09.log
  96. 138 0
      logs/all-2022-10-10.log
  97. 2 0
      logs/all-2022-10-11.log
  98. 84 0
      logs/all-2022-10-12.log
  99. 0 0
      logs/error-2022-10-04.log
  100. 0 0
      logs/error-2022-10-05.log

+ 2 - 1
.idea/vcs.xml

@@ -1,8 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="VcsDirectoryMappings">
-    <mapping directory="$PROJECT_DIR$/../../../.." vcs="Git" />
+    <mapping directory="$USER_HOME$" vcs="Git" />
     <mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
     <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
   </component>
 </project>

+ 1 - 1
Config/database_mysql.cnf

@@ -1,5 +1,5 @@
 [client]
-host = 127.0.0.1
+host = db
 port = 3306
 database = TestLaboratory
 user = root

+ 3 - 1
TestLaboratory/settings.py

@@ -29,6 +29,7 @@ TASK_ROOT = 'static/task-statement/'
 CASE_TEMPLATE_ROOT = 'static/case-template/测试用例模版.xlsx'
 CASE_FILE_ROOT = 'static/case-file/'
 CASE_FILE_EXPORT = 'static/case-file-export/'
+USER_FILE_ROOT = 'static/user-file-export/'
 HTTP_HEAD = 'http://172.26.0.14:8003/'
 
 
@@ -63,7 +64,8 @@ INSTALLED_APPS = [
     'plan',
     'apps.task',
     'file',
-    'log'
+    'log',
+    'group'
 ]
 
 MIDDLEWARE = [

+ 2 - 1
TestLaboratory/urls.py

@@ -24,5 +24,6 @@ urlpatterns = [
     path('api/v1/test-plans/', include('plan.urls')),
     path('api/v1/test-tasks/', include('task.urls')),
     path('api/v1/log-info/', include('log.urls')),
-    path('api/v1/files/', include('file.urls'))
+    path('api/v1/files/', include('file.urls')),
+    path('api/v1/group/', include('group.urls'))
 ] + static(settings.STATIC_URL, document_root=settings.STATICFILES_DIRS)

+ 0 - 0
apps/group/__init__.py


+ 3 - 0
apps/group/admin.py

@@ -0,0 +1,3 @@
+from django.contrib import admin
+
+# Register your models here.

+ 6 - 0
apps/group/apps.py

@@ -0,0 +1,6 @@
+from django.apps import AppConfig
+
+
+class GroupConfig(AppConfig):
+    default_auto_field = 'django.db.models.BigAutoField'
+    name = 'apps.group'

+ 31 - 0
apps/group/migrations/0001_initial.py

@@ -0,0 +1,31 @@
+# Generated by Django 3.2.4 on 2022-10-04 20:49
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    initial = True
+
+    dependencies = [
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='Group',
+            fields=[
+                ('name', models.CharField(max_length=128, verbose_name='组名')),
+                ('id', models.CharField(default='TestLaboratory_V1_Group_1', max_length=128, primary_key=True, serialize=False, unique=True, verbose_name='分组id')),
+                ('code', models.IntegerField(verbose_name='分组code')),
+                ('manager', models.CharField(max_length=60, verbose_name='管理员id')),
+                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
+                ('update_time', models.DateTimeField(auto_now=True, verbose_name='修改时间')),
+                ('delete', models.BooleanField(default=False)),
+            ],
+            options={
+                'verbose_name': '被测试软件',
+                'verbose_name_plural': '被测试软件',
+                'db_table': 'group',
+            },
+        ),
+    ]

+ 19 - 0
apps/group/migrations/0002_group_users.py

@@ -0,0 +1,19 @@
+# Generated by Django 3.2.4 on 2022-10-05 17:30
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('user', '0003_remove_user_group'),
+        ('group', '0001_initial'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='group',
+            name='users',
+            field=models.ManyToManyField(to='user.User', verbose_name='成员'),
+        ),
+    ]

+ 18 - 0
apps/group/migrations/0003_alter_group_code.py

@@ -0,0 +1,18 @@
+# Generated by Django 3.2.4 on 2022-10-05 19:27
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('group', '0002_group_users'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='group',
+            name='code',
+            field=models.CharField(max_length=12, verbose_name='分组code'),
+        ),
+    ]

+ 0 - 0
apps/group/migrations/__init__.py


+ 25 - 0
apps/group/models.py

@@ -0,0 +1,25 @@
+from django.db import models
+
+
+# Create your models here.
+from apps.user.models import User
+
+
+class Group(models.Model):
+    name = models.CharField(max_length=128, verbose_name='组名')
+    id = models.CharField(max_length=128, unique=True, primary_key=True, verbose_name='分组id',
+                          default='TestLaboratory_V1_Group_1')
+    code = models.CharField(max_length=12, verbose_name='分组code')
+    manager = models.CharField(max_length=60, verbose_name='管理员id')
+    users = models.ManyToManyField(User, verbose_name='成员')
+    create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
+    update_time = models.DateTimeField(auto_now=True, verbose_name='修改时间')
+    delete = models.BooleanField(default=False)
+
+    def __str__(self):
+        return self.name
+
+    class Meta:
+        verbose_name = '被测试软件'
+        verbose_name_plural = verbose_name
+        db_table = 'group'

+ 3 - 0
apps/group/tests.py

@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.

+ 11 - 0
apps/group/urls.py

@@ -0,0 +1,11 @@
+from django.urls import path
+from .views.grouplistview import GroupListView
+from .views.groupuserview import GroupUserView
+from .views.groupview import GroupView, GroupEdit
+
+urlpatterns = [
+    path('', GroupListView.as_view()),
+    path('user', GroupUserView.as_view()),
+    path('<str:group_id>', GroupView.as_view()),
+    path('<str:group_id>/edit', GroupEdit.as_view())
+]

+ 3 - 0
apps/group/views.py

@@ -0,0 +1,3 @@
+from django.shortcuts import render
+
+# Create your views here.

+ 0 - 0
apps/group/views/__init__.py


+ 93 - 0
apps/group/views/grouplistview.py

@@ -0,0 +1,93 @@
+import datetime
+import logging
+
+from django.http import HttpResponse
+from rest_framework.views import APIView
+from rest_framework.response import Response
+
+from apps.group.models import Group
+from apps.log.models import get_log, gen_log
+from apps.user.middleware.rolecontrol import RoleControl
+from apps.user.models import User
+from utils.util_add_id import get_id
+from utils.util_random import Produce
+
+logger = logging.getLogger('django')
+
+
+class GroupListView(APIView):
+    # create group
+    @staticmethod
+    @RoleControl
+    def post(request, *args, **kwargs):
+        name = request.POST.get('name')
+        manager_id = request.POST.get('manager_id')
+        manager = User.objects.filter(id=manager_id)
+        if not manager:
+            logger.error("用户不存在")
+            return HttpResponse(status=500, content='用户不存在')
+        manager = manager[0]
+        group = Group.objects.filter(name=name, delete=False)
+        if group:
+            logger.error("组名已存在,请修改组名重新上传")
+            return HttpResponse(status=500, content='组名已存在,请修改组名重新上传')
+        create_time = update_time = datetime.datetime.now()
+        group_id = get_id(Group, 'TestLaboratory_V1_Group_1')
+        code = Produce.auth_code(option='num')
+        group = Group.objects.create(id=group_id, code=code, manager=manager_id, name=name, create_time=create_time,
+                                     update_time=update_time)
+        executor, action, method = get_log(request)
+        gen_log(action, "分组", group.name, method, executor)
+        return Response({
+            'id': group.id,
+            'name': group.name,
+            'code': group.code,
+            'manager': manager.username,
+        })
+
+    # view log_list
+    @staticmethod
+    @RoleControl
+    def get(request, *args, **kwargs):
+        group_id = request.GET.get('id')
+        name = request.GET.get('name')
+        code = request.GET.get('code')
+        manager_id = request.GET.get('manager_id')
+        user_id = request.GET.get('user_id')
+
+        groups = Group.objects.order_by('-create_time').filter(delete=False)
+        if group_id:
+            groups = groups.filter(id=group_id)
+        if name:
+            groups = groups.filter(name=name)
+        if code:
+            groups = groups.filter(code=code)
+        if manager_id:
+            groups = groups.filter(manager=manager_id)
+        if user_id:
+            user = User.objects.filter(id=user_id)
+            if not user:
+                logger.error("用户不存在")
+                return HttpResponse(status=500, content='用户不存在')
+            user = user[0]
+            groups = groups & user.group_set.all()
+
+        return_groups = list()
+        for group in groups:
+            manager = User.objects.filter(id=group.manager)[0]
+            user_info = list()
+            users = group.users.order_by('-create_time')
+            for user in users:
+                user_info.append({
+                    'id': user.id,
+                    'username': user.username,
+                    'identity': user.identify
+                })
+            return_groups.append({
+                'id': group.id,
+                'name': group.name,
+                'code': group.code,
+                'manager': manager.username,
+                'members': user_info
+            })
+        return Response(return_groups)

+ 46 - 0
apps/group/views/groupuserview.py

@@ -0,0 +1,46 @@
+import logging
+
+from rest_framework.views import APIView
+from rest_framework.response import Response
+
+from apps.group.models import Group
+from apps.user.middleware.rolecontrol import RoleControl
+from apps.user.models import User
+
+logger = logging.getLogger('django')
+
+
+class GroupUserView(APIView):
+    # create group
+    @staticmethod
+    @RoleControl
+    def get(request, *args, **kwargs):
+        groups = Group.objects.filter(delete=False)
+        users = set(User.objects.filter(delete=False))
+
+        users_info = []
+        for group in groups:
+            user_group = {'groupName': group.name,
+                          'userList': list()
+                          }
+            users = users - set(group.users.all())
+            for user in group.users.all():
+                user_group['userList'].append({
+                    'userid': user.id,
+                    'username': user.username,
+                    'identify': user.identify,
+                    'is_login': user.is_login
+                })
+            users_info.append(user_group)
+        user_group = {'groupName': '默认分组',
+                      'userList': list()
+                      }
+        for user in users:
+            user_group['userList'].append({
+                'userid': user.id,
+                'username': user.username,
+                'identify': user.identify,
+                'is_login': user.is_login
+            })
+        users_info.append(user_group)
+        return Response(users_info)

+ 57 - 0
apps/group/views/groupview.py

@@ -0,0 +1,57 @@
+from django.http import HttpResponse
+from rest_framework.response import Response
+from rest_framework.views import APIView
+
+from apps.group.models import Group
+from apps.log.models import get_log, gen_log
+from apps.user.middleware.rolecontrol import RoleControl
+from apps.user.models import User
+
+import logging
+logger = logging.getLogger('django')
+
+
+class GroupView(APIView):
+    authentication_classes = []
+
+    # 删除分组
+    @staticmethod
+    @RoleControl
+    def delete(request, group_id, *args, **kwargs):
+        group = Group.objects.filter(id=group_id, delete=False)
+        if not group:
+            logger.error("分组已删除或不存在")
+        group = group[0]
+        users = group.users.all()
+        for user in users:
+            group.users.remove(user)
+        group.delete = True
+        group.save()
+        executor, action, method = get_log(request)
+        gen_log(action, "分组", group.name, method, executor)
+        return HttpResponse("删除完成")
+
+
+class GroupEdit(APIView):
+    authentication_classes = []
+
+    # 编辑分组
+    @staticmethod
+    @RoleControl
+    def post(request, group_id, *args, **kwargs):
+        name = request.POST.get('group_name')
+
+        if not name:
+            logger.error("组名不能位空")
+            return HttpResponse(status=500, content='组名不能位空')
+
+        group = Group.objects.filter(id=group_id, delete=False)
+        if not group:
+            logger.error("id为" + group_id + "的分组不存在")
+            return HttpResponse(status=404, content="id为" + group_id + "的分组不存在")
+        group = group[0]
+        group.name = name
+        group.save()
+        executor, action, method = get_log(request)
+        gen_log(action, "分组", group.name, method, executor)
+        return HttpResponse(status=200, content='修改已保存')

+ 1 - 0
apps/plan/views/planview.py

@@ -47,6 +47,7 @@ class PlanView(APIView):
                     'title': task.title,
                     'description': task.description,
                     'state': task.state,
+                    'executor': {'id': task.executor.id, 'name': task.executor.username},
                     'create_time': task.create_time,
                     'update_time': task.update_time
                 })

+ 23 - 0
apps/software/migrations/0003_auto_20221004_2044.py

@@ -0,0 +1,23 @@
+# Generated by Django 3.2.4 on 2022-10-04 20:44
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('software', '0002_alter_software_name'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='software',
+            name='id',
+            field=models.CharField(default='TestLaboratory_V1_Software_1', max_length=128, primary_key=True, serialize=False, unique=True, verbose_name='被测试软件编号'),
+        ),
+        migrations.AlterField(
+            model_name='version',
+            name='id',
+            field=models.CharField(default='TestLaboratory_V1_Version_1', max_length=128, primary_key=True, serialize=False, unique=True, verbose_name='软件版本'),
+        ),
+    ]

+ 2 - 2
apps/software/models.py

@@ -10,7 +10,7 @@ from utils.util_create_file import create_version_file
 
 class Software(models.Model):
     name = models.CharField(max_length=128, verbose_name='被测试软件名')
-    id = models.CharField(max_length=30, unique=True, primary_key=True, verbose_name='被测试软件编号',
+    id = models.CharField(max_length=128, unique=True, primary_key=True, verbose_name='被测试软件编号',
                           default='TestLaboratory_V1_Software_1')
     type = models.CharField(max_length=20, verbose_name='被测试软件类型')
     report_file = models.TextField(null=True, verbose_name='测试报告id文件')
@@ -28,7 +28,7 @@ class Software(models.Model):
 
 
 class Version(models.Model):
-    id = models.CharField(max_length=30, unique=True, primary_key=True, verbose_name='软件版本',
+    id = models.CharField(max_length=128, unique=True, primary_key=True, verbose_name='软件版本',
                           default='TestLaboratory_V1_Version_1')
     number = models.CharField(max_length=20, verbose_name='版本号')
     software = models.ForeignKey(Software, on_delete=models.CASCADE, verbose_name='所属软件')

+ 18 - 0
apps/task/migrations/0004_alter_testcase_id.py

@@ -0,0 +1,18 @@
+# Generated by Django 3.2.4 on 2022-10-04 20:44
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('task', '0003_auto_20220626_1630'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='testcase',
+            name='id',
+            field=models.CharField(default='TestLaboratory_V1_Case_1', max_length=128, primary_key=True, serialize=False, unique=True, verbose_name='测试用例编号'),
+        ),
+    ]

+ 1 - 1
apps/task/models.py

@@ -35,7 +35,7 @@ class TestTask(models.Model):
 
 
 class TestCase(models.Model):
-    id = models.CharField(max_length=30, unique=True, primary_key=True, verbose_name='测试用例编号',
+    id = models.CharField(max_length=128, unique=True, primary_key=True, verbose_name='测试用例编号',
                           default='TestLaboratory_V1_Case_1')
     task = models.ForeignKey(TestTask, on_delete=models.CASCADE, verbose_name='测试用例所在测试任务',
                              default='TestLaboratory_V1_Task_1')

+ 17 - 0
apps/user/migrations/0003_remove_user_group.py

@@ -0,0 +1,17 @@
+# Generated by Django 3.2.4 on 2022-10-05 17:30
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('user', '0002_auto_20220619_1043'),
+    ]
+
+    operations = [
+        migrations.RemoveField(
+            model_name='user',
+            name='group',
+        ),
+    ]

+ 1 - 1
apps/user/models.py

@@ -51,7 +51,7 @@ class User(models.Model):
     tel = models.CharField(max_length=20, verbose_name='联系方式')
     identify = models.IntegerField(verbose_name='身份信息')
     roles = models.ManyToManyField(Role, blank=True, verbose_name='角色信息')
-    group = models.CharField(max_length=128, default='默认分组', verbose_name='分组')
+    # group = models.CharField(max_length=128, default='默认分组', verbose_name='分组')
     create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
     update_time = models.DateTimeField(auto_now=True, verbose_name='修改时间')
     is_login = models.BooleanField(default=False)

+ 7 - 0
apps/user/urls.py

@@ -1,11 +1,18 @@
 from django.urls import path
+
+from .views.userexportview import UserExportView
+from .views.userjoinview import UserJoinView
 from .views.userlistview import UserListView, UserListLogin
+from .views.userquitview import UserQuitView
 from .views.userview import UserView, UserEdit
 
 urlpatterns = [
     # 注册登录代码
     path('', UserListView.as_view()),
     path('login', UserListLogin.as_view()),
+    path('export', UserExportView.as_view()),
     path('<str:user_id>', UserView.as_view()),
     path('<str:user_id>/edit', UserEdit.as_view()),
+    path('<str:user_id>/join', UserJoinView.as_view()),
+    path('<str:user_id>/quit', UserQuitView.as_view())
 ]

+ 47 - 0
apps/user/views/userexportview.py

@@ -0,0 +1,47 @@
+import datetime
+import logging
+import os
+
+from django.http import HttpResponse
+from rest_framework.response import Response
+from rest_framework.views import APIView
+
+from TestLaboratory.settings import USER_FILE_ROOT
+from apps.log.models import get_log, gen_log
+from apps.user.middleware.rolecontrol import RoleControl
+from apps.user.models import User
+from util_xlsx import write_to_xlsx
+from utils.util_add_id import get_id
+from utils.util_jwt import create_token_for_login
+
+logger = logging.getLogger('django')
+
+
+class UserExportView(APIView):
+    authentication_classes = []
+
+    @staticmethod
+    # @RoleControl
+    def get(request, *args, **kwargs):
+        user_all = User.objects.order_by('-create_time')
+
+        users_info = [['用户名', '企业', '联系方式', '系统角色']]
+        identify = ['系统管理员', '测试管理员', '测试工程师']
+        for user in user_all:
+            users_info.append([user.username, user.name, user.tel, identify[user.identify]])
+
+        file_name = "用户信息.xls"
+        update_time = datetime.datetime.now()
+        file_dir = USER_FILE_ROOT + str(update_time)
+        if not os.path.exists(file_dir):
+            os.makedirs(file_dir)
+        file_path = file_dir + "/" + file_name
+
+        sio = write_to_xlsx(file_path, users_info)
+        sio.seek(0)
+        response = HttpResponse(sio.getvalue(), content_type='application/vnd.ms-excel')
+        response['Content-Disposition'] = 'attachment; filename="{0}"'.format(file_name).encode('utf-8', 'ISO-8859-1')
+        response.write(sio.getvalue())
+        # executor, action, method = get_log(request)
+        # gen_log(action, "导出用户信息", "全部用户", method, executor)
+        return response

+ 36 - 0
apps/user/views/userjoinview.py

@@ -0,0 +1,36 @@
+import logging
+
+from django.http import HttpResponse
+from rest_framework.views import APIView
+
+from apps.group.models import Group
+from apps.log.models import get_log, gen_log
+from apps.user.middleware.rolecontrol import RoleControl
+from apps.user.models import User
+
+logger = logging.getLogger('django')
+
+
+class UserJoinView(APIView):
+    authentication_classes = []
+
+    @staticmethod
+    @RoleControl
+    def post(request, user_id, *args, **kwargs):
+        code = request.POST.get('code')
+        group = Group.objects.filter(code=code, delete=False)
+        if not group:
+            logger.error("分组不存在")
+            return HttpResponse(status=500, content='分组不存在')
+        group = group[0]
+
+        user = User.objects.filter(id=user_id)
+        if not user:
+            logger.error("用户不存在")
+            return HttpResponse(status=404, content='用户不存在')
+        user = user[0]
+
+        group.users.add(user)
+        executor, action, method = get_log(request)
+        gen_log(action, "加入分组", group.name, method, executor)
+        return HttpResponse(status=200, content='加入成功')

+ 10 - 27
apps/user/views/userlistview.py

@@ -25,7 +25,6 @@ class UserListView(APIView):
             'name': request.POST.get('name'),
             'tel': request.POST.get('tel'),
             'identify': request.POST.get('identify'),
-            'group': request.POST.get('group')
         }
 
         if not payload['username']:
@@ -34,8 +33,6 @@ class UserListView(APIView):
         if not payload['password']:
             logger.error("密码不能为空")
             return HttpResponse(status=500, content='密码不能为空')
-        if not payload['group']:
-            del payload['group']
         users = User.objects.filter(username=payload['username'])
         if users:
             logger.error("用户名已存在,请修改用户名重新上传")
@@ -46,7 +43,7 @@ class UserListView(APIView):
         payload['update_time'] = update_time
 
         payload['id'] = get_id(User, 'TestLaboratory_V1_User_1')
-        new_user = User.objects.create(**payload)
+        User.objects.create(**payload)
         return HttpResponse(status=200, content='创建成功')
 
     # user list
@@ -72,29 +69,16 @@ class UserListView(APIView):
             user_all = user_all.order_by(sort)
 
         users_info = []
-        user_group_index = {}
-        i = 0
         for user in user_all:
-            if user.group not in user_group_index.keys():
-                user_group_index[user.group] = i
-                i += 1
-                user_group = {'groupName': user.group, 'userList': [{
-                    'userid': user.id,
-                    'username': user.username,
-                    'identify': user.identify,
-                    'group': user.group,
-                    'is_login': user.is_login
-                }]}
-                users_info.append(user_group)
-            else:
-                users_info[user_group_index[user.group]]['userList'].append({
-                    'userid': user.id,
-                    'username': user.username,
-                    'identify': user.identify,
-                    'group': user.group,
-                    'is_login': user.is_login
-                })
-        return Response({'groupList': users_info})
+            users_info.append({
+                'userid': user.id,
+                'username': user.username,
+                'name': user.name,
+                'identify': user.identify,
+                'tel': user.tel,
+                'is_login': user.is_login
+            })
+        return Response(users_info)
 
 
 class UserListLogin(APIView):
@@ -122,7 +106,6 @@ class UserListLogin(APIView):
             'userid': user_obj.id,
             'username': user_obj.username,
             'identify': user_obj.identify,
-            'group': user_obj.group,
             'token': token
         }
 

+ 36 - 0
apps/user/views/userquitview.py

@@ -0,0 +1,36 @@
+import logging
+
+from django.http import HttpResponse
+from rest_framework.views import APIView
+
+from apps.group.models import Group
+from apps.log.models import get_log, gen_log
+from apps.user.middleware.rolecontrol import RoleControl
+from apps.user.models import User
+
+logger = logging.getLogger('django')
+
+
+class UserQuitView(APIView):
+    authentication_classes = []
+
+    @staticmethod
+    @RoleControl
+    def post(request, user_id, *args, **kwargs):
+        code = request.POST.get('code')
+        group = Group.objects.filter(code=code, delete=False)
+        if not group:
+            logger.error("分组不存在")
+            return HttpResponse(status=500, content='分组不存在')
+        group = group[0]
+
+        user = User.objects.filter(id=user_id)
+        if not user:
+            logger.error("用户不存在")
+            return HttpResponse(status=404, content='用户不存在')
+        user = user[0]
+
+        group.users.remove(user)
+        executor, action, method = get_log(request)
+        gen_log(action, "退出分组", group.name, method, executor)
+        return HttpResponse(status=200, content='退出成功')

+ 6 - 6
apps/user/views/userview.py

@@ -24,8 +24,7 @@ class UserView(APIView):
             'username': user.username,
             'name': user.name,
             'identify': user.identify,
-            'tel': user.tel,
-            'group': user.group
+            'tel': user.tel
         })
 
 
@@ -39,7 +38,6 @@ class UserEdit(APIView):
         username = request.POST.get('username')
         tel = request.POST.get('tel')
         password = request.POST.get('password')
-        group = request.POST.get('group')
 
         if not username:
             logger.error("用户名不能为空")
@@ -53,13 +51,15 @@ class UserEdit(APIView):
         if not user:
             logger.error("用户不存在")
             return HttpResponse(status=404, content='用户不存在')
+        other_user = User.objects.filter(username=username)
+        if other_user:
+            logger.error("用户名已存在,请修改用户名")
+            return HttpResponse(status=500, content='用户名已存在,请修改用户名')
         user = user[0]
         user.username = username
         user.password = password
         if tel:
             user.tel = tel
-        if group:
-            user.group = group
 
         user.save()
-        return HttpResponse(status=200, content='修改已保存')
+        return HttpResponse(status=200, content='修改已保存')

BIN
db/permission.xlsx


BIN
db/role_permissions.xlsx


BIN
db/software.xlsx


BIN
lims-frontend/dist.zip → lims-frontend/dist-recheck.zip


+ 1 - 1
lims-frontend/dist/browserconfig.xml

@@ -1,2 +1,2 @@
 <?xml version="1.0" encoding="utf-8"?>
-<browserconfig><msapplication><tile><square70x70logo src="/ms-icon-70x70.png"/><square150x150logo src="/ms-icon-150x150.png"/><square310x310logo src="/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>
+<browserconfig><msapplication><tile><square70x70logo src="/logo.png"/><square150x150logo src="/logo.png"/><square310x310logo src="/logo.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>

+ 1 - 1
lims-frontend/dist/css/chunk-42ba316b.cd462228.css → lims-frontend/dist/css/chunk-0281b3aa.9b88a26e.css

@@ -1 +1 @@
-.c-icon[data-v-75bbe00c]{margin-right:.3rem}.fade-enter-active[data-v-fc5d6588],.fade-leave-active[data-v-fc5d6588]{-webkit-transition:opacity .3s;transition:opacity .3s}.fade-enter[data-v-fc5d6588],.fade-leave-to[data-v-fc5d6588]{opacity:0}
+.c-icon[data-v-a36641b0]{margin-right:.3rem}.fade-enter-active[data-v-fc5d6588],.fade-leave-active[data-v-fc5d6588]{-webkit-transition:opacity .3s;transition:opacity .3s}.fade-enter[data-v-fc5d6588],.fade-leave-to[data-v-fc5d6588]{opacity:0}

+ 1 - 0
lims-frontend/dist/css/chunk-10d2afba.ce57d308.css

@@ -0,0 +1 @@
+.textMarginLeft[data-v-5aacad4c]{margin-left:50px}.infoColor[data-v-5aacad4c]{color:#909399}.fileButton[data-v-5aacad4c]{margin-left:20px;font-size:14px;font-weight:300}.indexColor[data-v-5aacad4c]{width:40px;color:#fff;text-align:center;font-size:12px;padding:2px;border-radius:10%;margin-top:10px;margin-right:10px;display:inline-block}

+ 0 - 0
lims-frontend/dist/css/chunk-6946487f.91f76422.css → lims-frontend/dist/css/chunk-16c48c2e.7fc2d857.css


+ 0 - 1
lims-frontend/dist/css/chunk-229e8b0d.c6a60be1.css

@@ -1 +0,0 @@
-.loginBox[data-v-9be1e39e]{height:400px;width:400px}.loginBox[data-v-9be1e39e],.rBox[data-v-9be1e39e]{margin:0 auto;margin-top:260px;background-color:#fcfcfc}.rBox[data-v-9be1e39e]{height:35%;width:500px}.inputArea[data-v-9be1e39e]{margin:50px 50px}.inputHeader[data-v-9be1e39e]{font-size:27px;font-family:Source Han Sans CN;font-weight:400;color:#444;margin-bottom:42px}.logtext[data-v-9be1e39e]{width:50px;height:13px;font-size:16px;font-family:Source Han Sans CN;font-weight:400;color:#a9a9b5}.loginBtn[data-v-9be1e39e]{width:349px;height:46px;background:#19a97b}

+ 1 - 1
lims-frontend/dist/css/chunk-b371d0a0.c1209d6e.css → lims-frontend/dist/css/chunk-241ed1ca.ebb262cf.css

@@ -1 +1 @@
-.c-icon[data-v-75bbe00c]{margin-right:.3rem}.fade-enter-active[data-v-3b21ac01],.fade-leave-active[data-v-3b21ac01]{-webkit-transition:opacity .3s;transition:opacity .3s}.fade-enter[data-v-3b21ac01],.fade-leave-to[data-v-3b21ac01]{opacity:0}
+.c-icon[data-v-a36641b0]{margin-right:.3rem}.fade-enter-active[data-v-3b21ac01],.fade-leave-active[data-v-3b21ac01]{-webkit-transition:opacity .3s;transition:opacity .3s}.fade-enter[data-v-3b21ac01],.fade-leave-to[data-v-3b21ac01]{opacity:0}

+ 1 - 0
lims-frontend/dist/css/chunk-32c93460.7d1c1019.css

@@ -0,0 +1 @@
+.textInfo[data-v-22361d9a]{margin-left:50px}

+ 1 - 0
lims-frontend/dist/css/chunk-3fa938b0.67c1abc3.css

@@ -0,0 +1 @@
+.textMarginLeft[data-v-442a705c]{margin-left:50px}.infoColor[data-v-442a705c]{color:#909399}

+ 0 - 1
lims-frontend/dist/css/chunk-4d04fe3e.84a27482.css

@@ -1 +0,0 @@
-.textMarginLeft[data-v-76602aff]{margin-left:50px}.infoColor[data-v-76602aff]{color:#909399}.fileButton[data-v-76602aff]{margin-left:20px;font-size:14px;font-weight:300}.indexColor[data-v-76602aff]{width:40px;color:#fff;text-align:center;font-size:12px;padding:2px;border-radius:10%;margin-top:10px;margin-right:10px;display:inline-block}

+ 0 - 1
lims-frontend/dist/css/chunk-50b41631.fd18f11f.css

@@ -1 +0,0 @@
-.mainArea[data-v-3fbe8a30]{width:60%;margin:100px auto}.formArea[data-v-3fbe8a30]{margin-top:40px}

+ 1 - 0
lims-frontend/dist/css/chunk-690a2502.516a67e1.css

@@ -0,0 +1 @@
+.mainArea[data-v-116f545a]{width:60%;margin:100px auto}.formArea[data-v-116f545a]{margin-top:40px}

+ 1 - 0
lims-frontend/dist/css/chunk-6dff90aa.0594504e.css

@@ -0,0 +1 @@
+.textMarginLeft[data-v-2eb73b2e]{margin-left:50px}.infoColor[data-v-2eb73b2e]{color:#909399}

+ 0 - 1
lims-frontend/dist/css/chunk-719f2106.b52eb0d9.css

@@ -1 +0,0 @@
-.textMarginLeft[data-v-d27f3a40]{margin-left:50px}.infoColor[data-v-d27f3a40]{color:#909399}

+ 1 - 1
lims-frontend/dist/css/chunk-457fc716.ba4579c0.css → lims-frontend/dist/css/chunk-7f50406f.42fd3f6b.css

@@ -1 +1 @@
-.c-icon[data-v-75bbe00c]{margin-right:.3rem}.fade-enter-active[data-v-71964fb9],.fade-leave-active[data-v-71964fb9]{-webkit-transition:opacity .3s;transition:opacity .3s}.fade-enter[data-v-71964fb9],.fade-leave-to[data-v-71964fb9]{opacity:0}
+.c-icon[data-v-a36641b0]{margin-right:.3rem}.fade-enter-active[data-v-71964fb9],.fade-leave-active[data-v-71964fb9]{-webkit-transition:opacity .3s;transition:opacity .3s}.fade-enter[data-v-71964fb9],.fade-leave-to[data-v-71964fb9]{opacity:0}

+ 0 - 1
lims-frontend/dist/css/chunk-8e31973a.873c8817.css

@@ -1 +0,0 @@
-.textInfo[data-v-6dcbe41a]{margin-left:50px}

+ 1 - 0
lims-frontend/dist/css/chunk-fd7a9eb6.3a5a8038.css

@@ -0,0 +1 @@
+.loginBox[data-v-5516f387]{height:-webkit-max-content;height:-moz-max-content;height:max-content;width:400px;position:relative}.loginBox[data-v-5516f387],.rBox[data-v-5516f387]{margin:0 auto;margin-top:260px;background-color:#fcfcfc}.rBox[data-v-5516f387]{height:35%;width:500px}.inputArea[data-v-5516f387]{margin:10px 50px 50px}.inputHeader[data-v-5516f387]{font-size:27px;font-family:Source Han Sans CN;font-weight:400;color:#444;margin-bottom:42px}.logtext[data-v-5516f387]{width:50px;height:13px;font-size:16px;font-family:Source Han Sans CN;font-weight:400;color:#a9a9b5}.loginBtn[data-v-5516f387]{width:349px;height:46px;background:#19a97b}

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
lims-frontend/dist/index.html


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/app.8c71c862.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/app.d810249c.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-0281b3aa.3123ee64.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-10d2afba.7c41cba7.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-140ff0e2.05dba521.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-16c48c2e.f5a39a80.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-1acc34dc.b58dc71a.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-229e8b0d.75c2772c.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-241ed1ca.8103bcd5.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-28e0a0ac.3420e88c.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-2c8f5038.0ba3baea.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-2c8f5038.513dbbc6.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-2f551c08.5d77341a.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-32c93460.dae9287a.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-3b2a3e5a.b0f060aa.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-3b2a3e5a.b9e9767f.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-3fa938b0.1debc69f.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-42ba316b.809a0c1d.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-457fc716.375dffe8.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-48594924.2f8c9f8d.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-48594924.ad0beba2.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-4d04fe3e.96858567.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-50b41631.efae28c2.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-61ad3c7e.211bd7a7.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-61ad3c7e.8f2fe99b.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-690a2502.666b5816.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-6d88c632.295cce00.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-6d88c632.970e4c1a.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-6dff90aa.798f9911.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-6fb66e82.04521d53.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-6fb66e82.d4cc4725.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-719f2106.86baecc1.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-7f50406f.ef617aba.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-8e31973a.dfc97e88.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-b371d0a0.1f329c3b.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
lims-frontend/dist/js/chunk-fd7a9eb6.156d0b8e.js


BIN
lims-frontend/dist/logo.png


BIN
lims-frontend/dist/logo2.png


+ 14 - 0
logs/all-2022-10-04.log

@@ -0,0 +1,14 @@
+[INFO] [2022-10-04 19:20:26,236] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[WARNING] [2022-10-04 19:20:28,248] [log.py:224] [log:log_response] - Not Found: /
+[WARNING] [2022-10-04 19:20:28,248] [basehttp.py:161] [basehttp:log_message] - "GET / HTTP/1.1" 404 2782
+[WARNING] [2022-10-04 19:20:28,360] [log.py:224] [log:log_response] - Not Found: /favicon.ico
+[WARNING] [2022-10-04 19:20:28,360] [basehttp.py:161] [basehttp:log_message] - "GET /favicon.ico HTTP/1.1" 404 2833
+[INFO] [2022-10-04 19:20:42,348] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/software HTTP/1.1" 301 0
+[WARNING] [2022-10-04 19:20:42,354] [log.py:224] [log:log_response] - Forbidden: /api/v1/software/
+[WARNING] [2022-10-04 19:20:42,354] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/software/ HTTP/1.1" 403 37
+[INFO] [2022-10-04 19:23:18,706] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/software HTTP/1.1" 301 0
+[WARNING] [2022-10-04 19:23:18,709] [log.py:224] [log:log_response] - Forbidden: /api/v1/software/
+[WARNING] [2022-10-04 19:23:18,709] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/software/ HTTP/1.1" 403 43
+[INFO] [2022-10-04 19:23:27,284] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/software HTTP/1.1" 301 0
+[WARNING] [2022-10-04 19:23:27,286] [log.py:224] [log:log_response] - Forbidden: /api/v1/software/
+[WARNING] [2022-10-04 19:23:27,286] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/software/ HTTP/1.1" 403 43

+ 74 - 0
logs/all-2022-10-05.log

@@ -0,0 +1,74 @@
+[INFO] [2022-10-05 19:38:38,957] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[ERROR] [2022-10-05 19:41:59,059] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/group
+Traceback (most recent call last):
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
+    response = get_response(request)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/utils/deprecation.py", line 116, in __call__
+    response = self.process_request(request)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/middleware/common.py", line 54, in process_request
+    path = self.get_full_path_with_slash(request)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/middleware/common.py", line 88, in get_full_path_with_slash
+    raise RuntimeError(
+RuntimeError: You called this URL via POST, but the URL doesn't end in a slash and you have APPEND_SLASH set. Django can't redirect to the slash URL while maintaining POST data. Change your form to point to 127.0.0.1:8000/api/v1/group/ (note the trailing slash), or set APPEND_SLASH=False in your Django settings.
+[ERROR] [2022-10-05 19:41:59,060] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/group HTTP/1.1" 500 73447
+[WARNING] [2022-10-05 19:42:51,380] [log.py:224] [log:log_response] - Forbidden: /api/v1/group/
+[WARNING] [2022-10-05 19:42:51,381] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/group/ HTTP/1.1" 403 37
+[ERROR] [2022-10-05 19:42:58,516] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/users/login
+Traceback (most recent call last):
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
+    response = get_response(request)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
+    response = wrapped_callback(request, *callback_args, **callback_kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
+    return view_func(*args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
+    return self.dispatch(request, *args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
+    response = self.handle_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
+    self.raise_uncaught_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
+    raise exc
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
+    response = handler(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/views/userlistview.py", line 125, in post
+    'group': user_obj.group,
+AttributeError: 'User' object has no attribute 'group'
+[ERROR] [2022-10-05 19:42:58,517] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/login HTTP/1.1" 500 94728
+[INFO] [2022-10-05 19:43:39,341] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/views/userlistview.py changed, reloading.
+[INFO] [2022-10-05 19:43:39,639] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-05 19:43:42,070] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/login HTTP/1.1" 200 292
+[ERROR] [2022-10-05 19:44:00,289] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/group/
+Traceback (most recent call last):
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
+    response = get_response(request)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
+    response = wrapped_callback(request, *callback_args, **callback_kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
+    return view_func(*args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
+    return self.dispatch(request, *args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
+    response = self.handle_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
+    self.raise_uncaught_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
+    raise exc
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
+    response = handler(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/middleware/rolecontrol.py", line 48, in __call__
+    return self.func(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py", line 30, in post
+    Group.objects.create(id=group_id, code=code, manager_id=manager_id, name=name, create_time=create_time,
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method
+    return getattr(self.get_queryset(), name)(*args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/query.py", line 451, in create
+    obj = self.model(**kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/base.py", line 503, in __init__
+    raise TypeError("%s() got an unexpected keyword argument '%s'" % (cls.__name__, kwarg))
+TypeError: Group() got an unexpected keyword argument 'manager_id'
+[ERROR] [2022-10-05 19:44:00,293] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/group/ HTTP/1.1" 500 116471
+[INFO] [2022-10-05 19:44:55,486] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-05 19:44:55,710] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-05 19:44:57,740] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/group/ HTTP/1.1" 200 12
+[INFO] [2022-10-06 09:58:00,351] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/urls.py changed, reloading.

+ 553 - 0
logs/all-2022-10-06.log

@@ -0,0 +1,553 @@
+[INFO] [2022-10-06 09:58:00,720] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 09:59:00,305] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/urls.py changed, reloading.
+[INFO] [2022-10-06 09:59:00,523] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 09:59:19,344] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/groupview.py changed, reloading.
+[INFO] [2022-10-06 09:59:19,565] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 09:59:48,415] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/groupview.py changed, reloading.
+[INFO] [2022-10-06 09:59:48,626] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:03:40,770] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/groupview.py changed, reloading.
+[INFO] [2022-10-06 10:03:41,037] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:06:20,058] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:06:20,371] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:06:29,931] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:06:30,222] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:08:37,175] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:08:37,486] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:09:00,541] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:09:00,839] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[ERROR] [2022-10-06 10:09:06,754] [grouplistview.py:27] [grouplistview:post] - 组名已存在,请修改组名重新上传
+[ERROR] [2022-10-06 10:09:06,754] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/group/
+[ERROR] [2022-10-06 10:09:06,754] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/group/ HTTP/1.1" 500 45
+[INFO] [2022-10-06 10:09:12,044] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/group/ HTTP/1.1" 200 89
+[ERROR] [2022-10-06 10:10:42,937] [groupview.py:23] [groupview:post] - 组名不能位空
+[ERROR] [2022-10-06 10:10:42,937] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/group/TestLaboratory_V1_Group_2/edit
+[ERROR] [2022-10-06 10:10:42,938] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/group/TestLaboratory_V1_Group_2/edit HTTP/1.1" 500 18
+[INFO] [2022-10-06 10:11:06,159] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/group/TestLaboratory_V1_Group_2/edit HTTP/1.1" 200 15
+[INFO] [2022-10-06 10:12:17,548] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:12:17,859] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:13:48,708] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:13:49,022] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:13:55,459] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:13:55,759] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:14:06,244] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:14:06,549] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:18:13,179] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:18:13,537] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:18:32,426] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:18:32,680] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:18:57,639] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:18:57,848] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:19:20,517] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:19:20,727] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:19:39,545] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:19:39,836] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:20:18,982] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:20:19,181] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:22:16,913] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:22:17,235] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:22:29,959] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:22:30,279] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:26:47,918] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:26:48,241] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:27:35,080] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:27:35,393] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:28:22,060] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:28:22,362] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:28:29,764] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:28:29,991] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:28:50,781] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:28:50,993] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:30:47,323] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:30:47,640] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[ERROR] [2022-10-06 10:31:21,296] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/group/
+Traceback (most recent call last):
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
+    response = get_response(request)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
+    response = wrapped_callback(request, *callback_args, **callback_kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
+    return view_func(*args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
+    return self.dispatch(request, *args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
+    response = self.handle_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
+    self.raise_uncaught_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
+    raise exc
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
+    response = handler(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/middleware/rolecontrol.py", line 48, in __call__
+    return self.func(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py", line 64, in get
+    for user in group.users:
+TypeError: 'ManyRelatedManager' object is not iterable
+[ERROR] [2022-10-06 10:31:21,297] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/ HTTP/1.1" 500 100883
+[INFO] [2022-10-06 10:31:24,952] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group HTTP/1.1" 301 0
+[ERROR] [2022-10-06 10:31:24,995] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/group/
+Traceback (most recent call last):
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
+    response = get_response(request)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
+    response = wrapped_callback(request, *callback_args, **callback_kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
+    return view_func(*args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
+    return self.dispatch(request, *args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
+    response = self.handle_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
+    self.raise_uncaught_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
+    raise exc
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
+    response = handler(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/middleware/rolecontrol.py", line 48, in __call__
+    return self.func(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py", line 64, in get
+    for user in group.users:
+TypeError: 'ManyRelatedManager' object is not iterable
+[ERROR] [2022-10-06 10:31:24,995] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/ HTTP/1.1" 500 101039
+[INFO] [2022-10-06 10:32:58,128] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:32:58,419] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:33:01,938] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group HTTP/1.1" 301 0
+[ERROR] [2022-10-06 10:33:02,042] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/group/
+Traceback (most recent call last):
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
+    response = get_response(request)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
+    response = wrapped_callback(request, *callback_args, **callback_kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
+    return view_func(*args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
+    return self.dispatch(request, *args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
+    response = self.handle_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
+    self.raise_uncaught_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
+    raise exc
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
+    response = handler(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/middleware/rolecontrol.py", line 48, in __call__
+    return self.func(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py", line 65, in get
+    for user in group.users:
+TypeError: 'ManyRelatedManager' object is not iterable
+[ERROR] [2022-10-06 10:33:02,043] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/ HTTP/1.1" 500 101255
+[INFO] [2022-10-06 10:33:14,177] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:33:14,401] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:33:15,647] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group HTTP/1.1" 301 0
+[ERROR] [2022-10-06 10:33:15,726] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/group/
+Traceback (most recent call last):
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
+    response = get_response(request)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
+    response = wrapped_callback(request, *callback_args, **callback_kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
+    return view_func(*args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
+    return self.dispatch(request, *args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 511, in dispatch
+    self.response = self.finalize_response(request, response, *args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 423, in finalize_response
+    assert isinstance(response, HttpResponseBase), (
+AssertionError: Expected a `Response`, `HttpResponse` or `HttpStreamingResponse` to be returned from the view, but received a `<class 'NoneType'>`
+[ERROR] [2022-10-06 10:33:15,726] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/ HTTP/1.1" 500 81482
+[INFO] [2022-10-06 10:33:42,316] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:33:42,611] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:33:45,799] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group HTTP/1.1" 301 0
+[INFO] [2022-10-06 10:33:45,843] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/ HTTP/1.1" 200 209
+[INFO] [2022-10-06 10:41:55,738] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:41:56,043] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:45:53,626] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/groupview.py changed, reloading.
+[INFO] [2022-10-06 10:45:53,975] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:47:25,424] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/groupview.py changed, reloading.
+[INFO] [2022-10-06 10:47:25,748] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:47:43,544] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/groupview.py changed, reloading.
+[INFO] [2022-10-06 10:47:43,832] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:50:15,710] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-06 10:50:16,024] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[WARNING] [2022-10-06 10:51:05,849] [log.py:224] [log:log_response] - Method Not Allowed: /api/v1/group/TestLaboratory_V1_Group_2
+[WARNING] [2022-10-06 10:51:05,873] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/TestLaboratory_V1_Group_2 HTTP/1.1" 405 40
+[INFO] [2022-10-06 10:51:13,483] [basehttp.py:161] [basehttp:log_message] - "DELETE /api/v1/group/TestLaboratory_V1_Group_2 HTTP/1.1" 200 12
+[INFO] [2022-10-06 10:51:18,277] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group HTTP/1.1" 301 0
+[INFO] [2022-10-06 10:51:18,295] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/ HTTP/1.1" 200 104
+[INFO] [2022-10-06 10:54:11,717] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?code=762563 HTTP/1.1" 301 0
+[INFO] [2022-10-06 10:54:11,751] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?code=762563 HTTP/1.1" 200 104
+[INFO] [2022-10-06 10:54:13,380] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?code=762563 HTTP/1.1" 301 0
+[INFO] [2022-10-06 10:54:13,403] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?code=762563 HTTP/1.1" 200 104
+[INFO] [2022-10-06 10:54:16,411] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?code=76256 HTTP/1.1" 301 0
+[INFO] [2022-10-06 10:54:16,422] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?code=76256 HTTP/1.1" 200 2
+[INFO] [2022-10-06 10:54:19,944] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?code=762563 HTTP/1.1" 301 0
+[INFO] [2022-10-06 10:54:19,966] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?code=762563 HTTP/1.1" 200 104
+[INFO] [2022-10-06 10:59:11,305] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/urls.py changed, reloading.
+[INFO] [2022-10-06 10:59:11,636] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 10:59:39,798] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/urls.py changed, reloading.
+[INFO] [2022-10-06 10:59:40,088] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[WARNING] [2022-10-06 11:00:58,926] [log.py:224] [log:log_response] - Method Not Allowed: /api/v1/users/TestLaboratory_V1_User_2/join
+[WARNING] [2022-10-06 11:00:58,927] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/users/TestLaboratory_V1_User_2/join HTTP/1.1" 405 40
+[ERROR] [2022-10-06 11:01:02,832] [userjoinview.py:23] [userjoinview:post] - 分组不存在
+[ERROR] [2022-10-06 11:01:02,832] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/users/TestLaboratory_V1_User_2/join
+[ERROR] [2022-10-06 11:01:02,833] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/TestLaboratory_V1_User_2/join HTTP/1.1" 500 15
+[INFO] [2022-10-06 11:01:19,975] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/TestLaboratory_V1_User_2/join HTTP/1.1" 200 12
+[INFO] [2022-10-06 11:02:18,984] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/urls.py changed, reloading.
+[INFO] [2022-10-06 11:02:19,337] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 11:03:10,716] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/urls.py changed, reloading.
+[INFO] [2022-10-06 11:03:10,984] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[ERROR] [2022-10-06 11:04:00,849] [userjoinview.py:23] [userjoinview:post] - 分组不存在
+[ERROR] [2022-10-06 11:04:00,850] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/users/TestLaboratory_V1_User_2/join
+[ERROR] [2022-10-06 11:04:00,851] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/TestLaboratory_V1_User_2/join HTTP/1.1" 500 15
+[INFO] [2022-10-06 11:04:15,014] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/TestLaboratory_V1_User_2/quit HTTP/1.1" 200 12
+[INFO] [2022-10-06 11:06:24,370] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/views/userlistview.py changed, reloading.
+[INFO] [2022-10-06 11:06:24,737] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 11:06:37,390] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/views/userlistview.py changed, reloading.
+[INFO] [2022-10-06 11:06:37,596] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 11:07:18,652] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/ HTTP/1.1" 200 12
+[INFO] [2022-10-06 11:08:30,640] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/login HTTP/1.1" 200 296
+[ERROR] [2022-10-06 11:08:49,679] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/users/
+Traceback (most recent call last):
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
+    response = get_response(request)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
+    response = wrapped_callback(request, *callback_args, **callback_kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
+    return view_func(*args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
+    return self.dispatch(request, *args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
+    response = self.handle_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
+    self.raise_uncaught_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
+    raise exc
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
+    response = handler(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/middleware/rolecontrol.py", line 48, in __call__
+    return self.func(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/views/userlistview.py", line 75, in get
+    if user.group not in user_group_index.keys():
+AttributeError: 'User' object has no attribute 'group'
+[ERROR] [2022-10-06 11:08:49,680] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/users/%0A HTTP/1.1" 500 101050
+[INFO] [2022-10-06 11:11:17,096] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/views/userlistview.py changed, reloading.
+[INFO] [2022-10-06 11:11:17,417] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 11:11:30,623] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/users/%0A HTTP/1.1" 200 493
+[INFO] [2022-10-06 11:12:18,900] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/users/%0A HTTP/1.1" 200 495
+[INFO] [2022-10-06 11:19:37,421] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/views/userlistview.py changed, reloading.
+[INFO] [2022-10-06 11:19:37,730] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 11:20:05,029] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/users/%0A HTTP/1.1" 200 515
+[INFO] [2022-10-06 11:22:38,128] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/views/userview.py changed, reloading.
+[INFO] [2022-10-06 11:22:38,457] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 11:23:01,401] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/views/userview.py changed, reloading.
+[INFO] [2022-10-06 11:23:01,675] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-06 11:25:03,778] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/group/ HTTP/1.1" 200 84
+[INFO] [2022-10-06 11:25:36,752] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/group/TestLaboratory_V1_Group_3/edit HTTP/1.1" 200 15
+[INFO] [2022-10-06 11:25:47,805] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?code=596640 HTTP/1.1" 301 0
+[INFO] [2022-10-06 11:25:47,825] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?code=596640 HTTP/1.1" 200 101
+[INFO] [2022-10-06 11:26:00,853] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/TestLaboratory_V1_User_2/join HTTP/1.1" 200 12
+[INFO] [2022-10-06 11:26:08,278] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group HTTP/1.1" 301 0
+[INFO] [2022-10-06 11:26:08,304] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/ HTTP/1.1" 200 267
+[INFO] [2022-10-06 11:26:33,793] [basehttp.py:161] [basehttp:log_message] - "DELETE /api/v1/group/TestLaboratory_V1_Group_3 HTTP/1.1" 200 12
+[INFO] [2022-10-06 11:26:37,691] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group HTTP/1.1" 301 0
+[INFO] [2022-10-06 11:26:37,712] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/ HTTP/1.1" 200 104
+[ERROR] [2022-10-06 11:26:58,747] [userlistview.py:38] [userlistview:post] - 用户名已存在,请修改用户名重新上传
+[ERROR] [2022-10-06 11:26:58,748] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/users/
+[ERROR] [2022-10-06 11:26:58,749] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/ HTTP/1.1" 500 51
+[INFO] [2022-10-06 11:27:04,845] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/ HTTP/1.1" 200 12
+[INFO] [2022-10-06 11:27:08,964] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/login HTTP/1.1" 200 296
+[ERROR] [2022-10-06 11:27:29,246] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/users/TestLaboratory_V1_User_5/edit
+Traceback (most recent call last):
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
+    return self.cursor.execute(sql, params)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/backends/mysql/base.py", line 73, in execute
+    return self.cursor.execute(query, args)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/cursors.py", line 170, in execute
+    result = self._query(query)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/cursors.py", line 328, in _query
+    conn.query(q)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/connections.py", line 516, in query
+    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/connections.py", line 727, in _read_query_result
+    result.read()
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/connections.py", line 1066, in read
+    first_packet = self.connection._read_packet()
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/connections.py", line 683, in _read_packet
+    packet.check_error()
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/protocol.py", line 220, in check_error
+    err.raise_mysql_exception(self._data)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/err.py", line 109, in raise_mysql_exception
+    raise errorclass(errno, errval)
+pymysql.err.IntegrityError: (1062, "Duplicate entry 'doctor' for key 'user.username'")
+
+The above exception was the direct cause of the following exception:
+
+Traceback (most recent call last):
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
+    response = get_response(request)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
+    response = wrapped_callback(request, *callback_args, **callback_kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
+    return view_func(*args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
+    return self.dispatch(request, *args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
+    response = self.handle_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
+    self.raise_uncaught_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
+    raise exc
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
+    response = handler(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/middleware/rolecontrol.py", line 48, in __call__
+    return self.func(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/views/userview.py", line 60, in post
+    user.save()
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/base.py", line 726, in save
+    self.save_base(using=using, force_insert=force_insert,
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/base.py", line 763, in save_base
+    updated = self._save_table(
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/base.py", line 845, in _save_table
+    updated = self._do_update(base_qs, using, pk_val, values, update_fields,
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/base.py", line 899, in _do_update
+    return filtered._update(values) > 0
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/query.py", line 802, in _update
+    return query.get_compiler(self.db).execute_sql(CURSOR)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1559, in execute_sql
+    cursor = super().execute_sql(result_type)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
+    cursor.execute(sql, params)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/backends/utils.py", line 98, in execute
+    return super().execute(sql, params)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/backends/utils.py", line 66, in execute
+    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
+    return executor(sql, params, many, context)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
+    return self.cursor.execute(sql, params)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
+    raise dj_exc_value.with_traceback(traceback) from exc_value
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
+    return self.cursor.execute(sql, params)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/backends/mysql/base.py", line 73, in execute
+    return self.cursor.execute(query, args)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/cursors.py", line 170, in execute
+    result = self._query(query)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/cursors.py", line 328, in _query
+    conn.query(q)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/connections.py", line 516, in query
+    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/connections.py", line 727, in _read_query_result
+    result.read()
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/connections.py", line 1066, in read
+    first_packet = self.connection._read_packet()
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/connections.py", line 683, in _read_packet
+    packet.check_error()
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/protocol.py", line 220, in check_error
+    err.raise_mysql_exception(self._data)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/err.py", line 109, in raise_mysql_exception
+    raise errorclass(errno, errval)
+django.db.utils.IntegrityError: (1062, "Duplicate entry 'doctor' for key 'user.username'")
+[ERROR] [2022-10-06 11:27:29,256] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/TestLaboratory_V1_User_5/edit HTTP/1.1" 500 248807
+[ERROR] [2022-10-06 11:27:32,414] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/users/TestLaboratory_V1_User_5/edit
+Traceback (most recent call last):
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
+    return self.cursor.execute(sql, params)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/backends/mysql/base.py", line 73, in execute
+    return self.cursor.execute(query, args)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/cursors.py", line 170, in execute
+    result = self._query(query)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/cursors.py", line 328, in _query
+    conn.query(q)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/connections.py", line 516, in query
+    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/connections.py", line 727, in _read_query_result
+    result.read()
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/connections.py", line 1066, in read
+    first_packet = self.connection._read_packet()
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/connections.py", line 683, in _read_packet
+    packet.check_error()
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/protocol.py", line 220, in check_error
+    err.raise_mysql_exception(self._data)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/err.py", line 109, in raise_mysql_exception
+    raise errorclass(errno, errval)
+pymysql.err.IntegrityError: (1062, "Duplicate entry 'doctor' for key 'user.username'")
+
+The above exception was the direct cause of the following exception:
+
+Traceback (most recent call last):
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
+    response = get_response(request)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
+    response = wrapped_callback(request, *callback_args, **callback_kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
+    return view_func(*args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
+    return self.dispatch(request, *args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
+    response = self.handle_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
+    self.raise_uncaught_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
+    raise exc
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
+    response = handler(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/middleware/rolecontrol.py", line 48, in __call__
+    return self.func(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/views/userview.py", line 60, in post
+    user.save()
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/base.py", line 726, in save
+    self.save_base(using=using, force_insert=force_insert,
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/base.py", line 763, in save_base
+    updated = self._save_table(
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/base.py", line 845, in _save_table
+    updated = self._do_update(base_qs, using, pk_val, values, update_fields,
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/base.py", line 899, in _do_update
+    return filtered._update(values) > 0
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/query.py", line 802, in _update
+    return query.get_compiler(self.db).execute_sql(CURSOR)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1559, in execute_sql
+    cursor = super().execute_sql(result_type)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
+    cursor.execute(sql, params)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/backends/utils.py", line 98, in execute
+    return super().execute(sql, params)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/backends/utils.py", line 66, in execute
+    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
+    return executor(sql, params, many, context)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
+    return self.cursor.execute(sql, params)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
+    raise dj_exc_value.with_traceback(traceback) from exc_value
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
+    return self.cursor.execute(sql, params)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/backends/mysql/base.py", line 73, in execute
+    return self.cursor.execute(query, args)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/cursors.py", line 170, in execute
+    result = self._query(query)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/cursors.py", line 328, in _query
+    conn.query(q)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/connections.py", line 516, in query
+    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/connections.py", line 727, in _read_query_result
+    result.read()
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/connections.py", line 1066, in read
+    first_packet = self.connection._read_packet()
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/connections.py", line 683, in _read_packet
+    packet.check_error()
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/protocol.py", line 220, in check_error
+    err.raise_mysql_exception(self._data)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/err.py", line 109, in raise_mysql_exception
+    raise errorclass(errno, errval)
+django.db.utils.IntegrityError: (1062, "Duplicate entry 'doctor' for key 'user.username'")
+[ERROR] [2022-10-06 11:27:32,477] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/TestLaboratory_V1_User_5/edit HTTP/1.1" 500 248676
+[ERROR] [2022-10-06 11:28:12,635] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/users/TestLaboratory_V1_User_5/edit
+Traceback (most recent call last):
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
+    return self.cursor.execute(sql, params)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/backends/mysql/base.py", line 73, in execute
+    return self.cursor.execute(query, args)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/cursors.py", line 170, in execute
+    result = self._query(query)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/cursors.py", line 328, in _query
+    conn.query(q)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/connections.py", line 516, in query
+    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/connections.py", line 727, in _read_query_result
+    result.read()
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/connections.py", line 1066, in read
+    first_packet = self.connection._read_packet()
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/connections.py", line 683, in _read_packet
+    packet.check_error()
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/protocol.py", line 220, in check_error
+    err.raise_mysql_exception(self._data)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/err.py", line 109, in raise_mysql_exception
+    raise errorclass(errno, errval)
+pymysql.err.IntegrityError: (1062, "Duplicate entry 'doctor' for key 'user.username'")
+
+The above exception was the direct cause of the following exception:
+
+Traceback (most recent call last):
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
+    response = get_response(request)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
+    response = wrapped_callback(request, *callback_args, **callback_kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
+    return view_func(*args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
+    return self.dispatch(request, *args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
+    response = self.handle_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
+    self.raise_uncaught_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
+    raise exc
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
+    response = handler(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/middleware/rolecontrol.py", line 48, in __call__
+    return self.func(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/views/userview.py", line 60, in post
+    user.save()
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/base.py", line 726, in save
+    self.save_base(using=using, force_insert=force_insert,
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/base.py", line 763, in save_base
+    updated = self._save_table(
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/base.py", line 845, in _save_table
+    updated = self._do_update(base_qs, using, pk_val, values, update_fields,
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/base.py", line 899, in _do_update
+    return filtered._update(values) > 0
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/query.py", line 802, in _update
+    return query.get_compiler(self.db).execute_sql(CURSOR)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1559, in execute_sql
+    cursor = super().execute_sql(result_type)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
+    cursor.execute(sql, params)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/backends/utils.py", line 98, in execute
+    return super().execute(sql, params)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/backends/utils.py", line 66, in execute
+    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
+    return executor(sql, params, many, context)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
+    return self.cursor.execute(sql, params)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
+    raise dj_exc_value.with_traceback(traceback) from exc_value
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
+    return self.cursor.execute(sql, params)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/backends/mysql/base.py", line 73, in execute
+    return self.cursor.execute(query, args)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/cursors.py", line 170, in execute
+    result = self._query(query)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/cursors.py", line 328, in _query
+    conn.query(q)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/connections.py", line 516, in query
+    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/connections.py", line 727, in _read_query_result
+    result.read()
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/connections.py", line 1066, in read
+    first_packet = self.connection._read_packet()
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/connections.py", line 683, in _read_packet
+    packet.check_error()
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/protocol.py", line 220, in check_error
+    err.raise_mysql_exception(self._data)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/pymysql/err.py", line 109, in raise_mysql_exception
+    raise errorclass(errno, errval)
+django.db.utils.IntegrityError: (1062, "Duplicate entry 'doctor' for key 'user.username'")
+[ERROR] [2022-10-06 11:28:12,644] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/TestLaboratory_V1_User_5/edit HTTP/1.1" 500 248676
+[INFO] [2022-10-06 11:30:02,301] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/views/userview.py changed, reloading.
+[INFO] [2022-10-06 11:30:02,606] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[ERROR] [2022-10-06 11:30:05,527] [userview.py:56] [userview:post] - 用户名已存在,请修改用户名
+[ERROR] [2022-10-06 11:30:05,528] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/users/TestLaboratory_V1_User_5/edit
+[ERROR] [2022-10-06 11:30:05,528] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/TestLaboratory_V1_User_5/edit HTTP/1.1" 500 39
+[INFO] [2022-10-06 11:30:12,244] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/TestLaboratory_V1_User_5/edit HTTP/1.1" 200 15
+[INFO] [2022-10-06 11:30:31,858] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/users/TestLaboratory_V1_User_6 HTTP/1.1" 200 67
+[ERROR] [2022-10-06 11:31:17,763] [userlistview.py:94] [userlistview:post] - 用户名或密码错误
+[ERROR] [2022-10-06 11:31:17,764] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/users/login
+[ERROR] [2022-10-06 11:31:17,765] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/login HTTP/1.1" 500 24
+[INFO] [2022-10-06 11:31:26,287] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/login HTTP/1.1" 200 307
+[INFO] [2022-10-06 11:31:29,886] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/users/%0A HTTP/1.1" 200 622
+[INFO] [2022-10-06 11:31:34,608] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/users/TestLaboratory_V1_User_6 HTTP/1.1" 200 67
+[ERROR] [2022-10-06 11:31:40,214] [userview.py:56] [userview:post] - 用户名已存在,请修改用户名
+[ERROR] [2022-10-06 11:31:40,215] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/users/TestLaboratory_V1_User_5/edit
+[ERROR] [2022-10-06 11:31:40,215] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/TestLaboratory_V1_User_5/edit HTTP/1.1" 500 39
+[INFO] [2022-10-06 11:31:44,583] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/TestLaboratory_V1_User_5/edit HTTP/1.1" 200 15

+ 103 - 0
logs/all-2022-10-09.log

@@ -0,0 +1,103 @@
+[INFO] [2022-10-09 21:37:27,287] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-09 21:38:28,286] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-09 21:39:11,185] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/login HTTP/1.1" 200 292
+[INFO] [2022-10-09 21:39:31,648] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group HTTP/1.1" 301 0
+[INFO] [2022-10-09 21:39:31,670] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/ HTTP/1.1" 200 2
+[INFO] [2022-10-09 21:39:37,173] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/group/ HTTP/1.1" 200 84
+[INFO] [2022-10-09 21:39:40,101] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/group/ HTTP/1.1" 200 84
+[INFO] [2022-10-09 21:39:43,734] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/group/ HTTP/1.1" 200 84
+[INFO] [2022-10-09 21:39:48,370] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group HTTP/1.1" 301 0
+[INFO] [2022-10-09 21:39:48,402] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/ HTTP/1.1" 200 295
+[INFO] [2022-10-09 21:40:25,109] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/TestLaboratory_V1_User_1/join HTTP/1.1" 200 12
+[INFO] [2022-10-09 21:40:46,677] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?user_id=160636 HTTP/1.1" 301 0
+[ERROR] [2022-10-09 21:40:46,689] [grouplistview.py:70] [grouplistview:get] - 用户不存在
+[ERROR] [2022-10-09 21:40:46,690] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/group/
+[ERROR] [2022-10-09 21:40:46,690] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?user_id=160636 HTTP/1.1" 500 15
+[INFO] [2022-10-09 21:41:03,886] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?user_id=TestLaboratory_V1_User_1 HTTP/1.1" 301 0
+[INFO] [2022-10-09 21:41:03,915] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?user_id=TestLaboratory_V1_User_1 HTTP/1.1" 200 167
+[INFO] [2022-10-09 21:41:38,778] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group HTTP/1.1" 301 0
+[INFO] [2022-10-09 21:41:38,802] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/ HTTP/1.1" 200 363
+[INFO] [2022-10-09 21:41:49,953] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/TestLaboratory_V1_User_1/join HTTP/1.1" 200 12
+[INFO] [2022-10-09 21:41:54,626] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?user_id=TestLaboratory_V1_User_1 HTTP/1.1" 301 0
+[INFO] [2022-10-09 21:41:54,656] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?user_id=TestLaboratory_V1_User_1 HTTP/1.1" 200 333
+[INFO] [2022-10-09 21:45:01,664] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-09 21:45:02,067] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-09 21:45:26,173] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-09 21:45:26,560] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-09 21:45:30,334] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?user_id=TestLaboratory_V1_User_1 HTTP/1.1" 301 0
+[INFO] [2022-10-09 21:45:30,381] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?user_id=TestLaboratory_V1_User_1 HTTP/1.1" 200 333
+[INFO] [2022-10-09 21:45:38,581] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?code=596640&user_id=TestLaboratory_V1_User_1 HTTP/1.1" 301 0
+[INFO] [2022-10-09 21:45:38,597] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?code=596640&user_id=TestLaboratory_V1_User_1 HTTP/1.1" 200 2
+[INFO] [2022-10-09 21:45:41,972] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?user_id=TestLaboratory_V1_User_1 HTTP/1.1" 301 0
+[INFO] [2022-10-09 21:45:41,994] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?user_id=TestLaboratory_V1_User_1 HTTP/1.1" 200 333
+[INFO] [2022-10-09 21:45:50,310] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?code=160636&user_id=TestLaboratory_V1_User_1 HTTP/1.1" 301 0
+[INFO] [2022-10-09 21:45:50,329] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?code=160636&user_id=TestLaboratory_V1_User_1 HTTP/1.1" 200 167
+[INFO] [2022-10-09 21:54:50,598] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?code=160636&manager_id=TestLaboratory_V1_User_1&user_id=TestLaboratory_V1_User_1 HTTP/1.1" 301 0
+[INFO] [2022-10-09 21:54:50,621] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?code=160636&manager_id=TestLaboratory_V1_User_1&user_id=TestLaboratory_V1_User_1 HTTP/1.1" 200 167
+[INFO] [2022-10-09 21:54:55,262] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?manager_id=TestLaboratory_V1_User_1&user_id=TestLaboratory_V1_User_1 HTTP/1.1" 301 0
+[INFO] [2022-10-09 21:54:55,282] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?manager_id=TestLaboratory_V1_User_1&user_id=TestLaboratory_V1_User_1 HTTP/1.1" 200 333
+[ERROR] [2022-10-09 21:55:12,063] [grouplistview.py:32] [grouplistview:post] - 组名已存在,请修改组名重新上传
+[ERROR] [2022-10-09 21:55:12,063] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/group/
+[ERROR] [2022-10-09 21:55:12,063] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/group/ HTTP/1.1" 500 45
+[INFO] [2022-10-09 21:55:33,077] [basehttp.py:161] [basehttp:log_message] - "DELETE /api/v1/group/TestLaboratory_V1_Group_1 HTTP/1.1" 200 12
+[INFO] [2022-10-09 21:55:35,843] [basehttp.py:161] [basehttp:log_message] - "DELETE /api/v1/group/TestLaboratory_V1_Group_2 HTTP/1.1" 200 12
+[INFO] [2022-10-09 21:55:38,582] [basehttp.py:161] [basehttp:log_message] - "DELETE /api/v1/group/TestLaboratory_V1_Group_3 HTTP/1.1" 200 12
+[ERROR] [2022-10-09 21:55:41,145] [groupview.py:23] [groupview:delete] - 分组已删除或不存在
+[ERROR] [2022-10-09 21:55:41,226] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/group/TestLaboratory_V1_Group_4
+Traceback (most recent call last):
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
+    response = get_response(request)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
+    response = wrapped_callback(request, *callback_args, **callback_kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
+    return view_func(*args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
+    return self.dispatch(request, *args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
+    response = self.handle_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
+    self.raise_uncaught_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
+    raise exc
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
+    response = handler(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/middleware/rolecontrol.py", line 48, in __call__
+    return self.func(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/groupview.py", line 24, in delete
+    group = group[0]
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/db/models/query.py", line 300, in __getitem__
+    return self._result_cache[k]
+IndexError: list index out of range
+[ERROR] [2022-10-09 21:55:41,237] [basehttp.py:161] [basehttp:log_message] - "DELETE /api/v1/group/TestLaboratory_V1_Group_4 HTTP/1.1" 500 103776
+[INFO] [2022-10-09 21:55:57,890] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group HTTP/1.1" 301 0
+[INFO] [2022-10-09 21:55:57,903] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/ HTTP/1.1" 200 2
+[INFO] [2022-10-09 21:56:08,444] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/group/ HTTP/1.1" 200 84
+[INFO] [2022-10-09 21:56:33,987] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?manager_id=TestLaboratory_V1_User_1 HTTP/1.1" 301 0
+[INFO] [2022-10-09 21:56:34,007] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?manager_id=TestLaboratory_V1_User_1 HTTP/1.1" 200 99
+[INFO] [2022-10-09 21:56:38,942] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?user_id=TestLaboratory_V1_User_1 HTTP/1.1" 301 0
+[INFO] [2022-10-09 21:56:38,959] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?user_id=TestLaboratory_V1_User_1 HTTP/1.1" 200 2
+[INFO] [2022-10-09 21:56:42,219] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?manager_id=TestLaboratory_V1_User_1 HTTP/1.1" 301 0
+[INFO] [2022-10-09 21:56:42,234] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?manager_id=TestLaboratory_V1_User_1 HTTP/1.1" 200 99
+[INFO] [2022-10-09 21:56:52,868] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?manager_id=TestLaboratory_V1_User_1&user_id=TestLaboratory_V1_User_1 HTTP/1.1" 301 0
+[INFO] [2022-10-09 21:56:52,878] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?manager_id=TestLaboratory_V1_User_1&user_id=TestLaboratory_V1_User_1 HTTP/1.1" 200 2
+[INFO] [2022-10-09 22:03:16,561] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?user_id=TestLaboratory_V1_User_1 HTTP/1.1" 301 0
+[INFO] [2022-10-09 22:03:16,577] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?user_id=TestLaboratory_V1_User_1 HTTP/1.1" 200 2
+[INFO] [2022-10-09 22:03:19,375] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?manager_id=TestLaboratory_V1_User_1 HTTP/1.1" 301 0
+[INFO] [2022-10-09 22:03:19,389] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?manager_id=TestLaboratory_V1_User_1 HTTP/1.1" 200 99
+[INFO] [2022-10-09 22:03:33,337] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/TestLaboratory_V1_User_1/join HTTP/1.1" 200 12
+[INFO] [2022-10-09 22:03:44,349] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?manager_id=TestLaboratory_V1_User_1 HTTP/1.1" 301 0
+[INFO] [2022-10-09 22:03:44,369] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?manager_id=TestLaboratory_V1_User_1 HTTP/1.1" 200 167
+[INFO] [2022-10-09 22:03:48,030] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?manager_id=TestLaboratory_V1_User_1&user_id=TestLaboratory_V1_User_1 HTTP/1.1" 301 0
+[INFO] [2022-10-09 22:03:48,051] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?manager_id=TestLaboratory_V1_User_1&user_id=TestLaboratory_V1_User_1 HTTP/1.1" 200 167
+[INFO] [2022-10-09 22:04:22,426] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?manager_id=&user_id=TestLaboratory_V1_User_1 HTTP/1.1" 301 0
+[INFO] [2022-10-09 22:04:22,449] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?manager_id=&user_id=TestLaboratory_V1_User_1 HTTP/1.1" 200 167
+[INFO] [2022-10-09 22:05:28,433] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-09 22:05:28,748] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-09 22:05:31,858] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?manager_id=&user_id=TestLaboratory_V1_User_1 HTTP/1.1" 301 0
+[INFO] [2022-10-09 22:05:31,908] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?manager_id=&user_id=TestLaboratory_V1_User_1 HTTP/1.1" 200 167
+[INFO] [2022-10-09 22:05:45,583] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-09 22:05:45,782] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-09 22:05:47,887] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?manager_id=&user_id=TestLaboratory_V1_User_1 HTTP/1.1" 301 0
+[INFO] [2022-10-09 22:05:47,937] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?manager_id=&user_id=TestLaboratory_V1_User_1 HTTP/1.1" 200 167
+[INFO] [2022-10-09 22:06:11,800] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/grouplistview.py changed, reloading.
+[INFO] [2022-10-09 22:06:12,028] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader

+ 138 - 0
logs/all-2022-10-10.log

@@ -0,0 +1,138 @@
+[INFO] [2022-10-10 21:58:15,970] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-10 21:59:15,606] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/login HTTP/1.1" 200 292
+[WARNING] [2022-10-10 21:59:29,828] [log.py:224] [log:log_response] - Method Not Allowed: /api/v1/group/user
+[WARNING] [2022-10-10 21:59:29,829] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/user HTTP/1.1" 405 40
+[INFO] [2022-10-10 21:59:47,836] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/urls.py changed, reloading.
+[INFO] [2022-10-10 21:59:48,131] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[WARNING] [2022-10-10 22:00:06,054] [log.py:224] [log:log_response] - Not Found: /api/v1/group/user/
+[WARNING] [2022-10-10 22:00:06,055] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/user/ HTTP/1.1" 404 3544
+[WARNING] [2022-10-10 22:00:25,949] [log.py:224] [log:log_response] - Method Not Allowed: /api/v1/group/user
+[WARNING] [2022-10-10 22:00:25,949] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/user HTTP/1.1" 405 40
+[WARNING] [2022-10-10 22:03:17,499] [log.py:224] [log:log_response] - Method Not Allowed: /api/v1/group/user
+[WARNING] [2022-10-10 22:03:17,500] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/user HTTP/1.1" 405 40
+[INFO] [2022-10-10 22:04:29,468] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/groupuserview.py changed, reloading.
+[INFO] [2022-10-10 22:04:29,778] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[WARNING] [2022-10-10 22:04:35,924] [log.py:224] [log:log_response] - Method Not Allowed: /api/v1/group/user
+[WARNING] [2022-10-10 22:04:35,925] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/user HTTP/1.1" 405 40
+[INFO] [2022-10-10 22:06:20,734] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/groupuserview.py changed, reloading.
+[INFO] [2022-10-10 22:06:21,032] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[WARNING] [2022-10-10 22:06:23,910] [log.py:224] [log:log_response] - Method Not Allowed: /api/v1/group/user
+[WARNING] [2022-10-10 22:06:23,911] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/user HTTP/1.1" 405 40
+[WARNING] [2022-10-10 22:06:26,059] [log.py:224] [log:log_response] - Method Not Allowed: /api/v1/group/user
+[WARNING] [2022-10-10 22:06:26,060] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/user HTTP/1.1" 405 40
+[INFO] [2022-10-10 22:06:32,718] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/urls.py changed, reloading.
+[INFO] [2022-10-10 22:06:32,996] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[WARNING] [2022-10-10 22:06:34,927] [log.py:224] [log:log_response] - Not Found: /api/v1/group/user
+[WARNING] [2022-10-10 22:06:34,928] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/user HTTP/1.1" 404 3361
+[WARNING] [2022-10-10 22:06:46,833] [log.py:224] [log:log_response] - Not Found: /api/v1/group/user
+[WARNING] [2022-10-10 22:06:46,833] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/user HTTP/1.1" 404 3361
+[INFO] [2022-10-10 22:06:55,130] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/urls.py changed, reloading.
+[INFO] [2022-10-10 22:06:55,413] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[WARNING] [2022-10-10 22:06:58,384] [log.py:224] [log:log_response] - Method Not Allowed: /api/v1/group/user
+[WARNING] [2022-10-10 22:06:58,385] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/user HTTP/1.1" 405 40
+[INFO] [2022-10-10 22:07:05,001] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/urls.py changed, reloading.
+[INFO] [2022-10-10 22:07:05,298] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[WARNING] [2022-10-10 22:07:06,591] [log.py:224] [log:log_response] - Method Not Allowed: /api/v1/group/user
+[WARNING] [2022-10-10 22:07:06,591] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/user HTTP/1.1" 405 40
+[INFO] [2022-10-10 22:07:13,825] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/urls.py changed, reloading.
+[INFO] [2022-10-10 22:07:14,036] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-10 22:07:55,343] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/urls.py changed, reloading.
+[INFO] [2022-10-10 22:07:55,558] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[WARNING] [2022-10-10 22:07:57,602] [log.py:224] [log:log_response] - Forbidden: /api/v1/group/user
+[WARNING] [2022-10-10 22:07:57,603] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/user HTTP/1.1" 403 43
+[WARNING] [2022-10-10 22:09:26,351] [log.py:224] [log:log_response] - Forbidden: /api/v1/group/user
+[WARNING] [2022-10-10 22:09:26,352] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/user HTTP/1.1" 403 43
+[WARNING] [2022-10-10 22:09:27,862] [log.py:224] [log:log_response] - Forbidden: /api/v1/group/user
+[WARNING] [2022-10-10 22:09:27,863] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/user HTTP/1.1" 403 43
+[WARNING] [2022-10-10 22:09:28,631] [log.py:224] [log:log_response] - Forbidden: /api/v1/group/user
+[WARNING] [2022-10-10 22:09:28,632] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/user HTTP/1.1" 403 43
+[INFO] [2022-10-10 22:09:52,008] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[WARNING] [2022-10-10 22:09:55,125] [log.py:224] [log:log_response] - Forbidden: /api/v1/group/user
+[WARNING] [2022-10-10 22:09:55,125] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/user HTTP/1.1" 403 43
+[INFO] [2022-10-10 22:09:59,524] [basehttp.py:161] [basehttp:log_message] - "POST /api/v1/users/login HTTP/1.1" 200 292
+[WARNING] [2022-10-10 22:10:16,691] [log.py:224] [log:log_response] - Forbidden: /api/v1/group/user
+[WARNING] [2022-10-10 22:10:16,692] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/user HTTP/1.1" 403 43
+[WARNING] [2022-10-10 22:10:27,353] [log.py:224] [log:log_response] - Forbidden: /api/v1/group/user
+[WARNING] [2022-10-10 22:10:27,353] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/user HTTP/1.1" 403 43
+[ERROR] [2022-10-10 22:10:44,538] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/group/user
+Traceback (most recent call last):
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
+    response = get_response(request)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
+    response = wrapped_callback(request, *callback_args, **callback_kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
+    return view_func(*args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
+    return self.dispatch(request, *args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
+    response = self.handle_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
+    self.raise_uncaught_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
+    raise exc
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
+    response = handler(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/middleware/rolecontrol.py", line 48, in __call__
+    return self.func(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/groupuserview.py", line 26, in get
+    users = users - group.users
+TypeError: unsupported operand type(s) for -: 'QuerySet' and 'ManyRelatedManager'
+[ERROR] [2022-10-10 22:10:44,539] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/user HTTP/1.1" 500 100745
+[INFO] [2022-10-10 22:11:57,718] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/groupuserview.py changed, reloading.
+[INFO] [2022-10-10 22:11:58,030] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[ERROR] [2022-10-10 22:12:00,124] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/group/user
+Traceback (most recent call last):
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
+    response = get_response(request)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
+    response = wrapped_callback(request, *callback_args, **callback_kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
+    return view_func(*args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
+    return self.dispatch(request, *args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
+    response = self.handle_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
+    self.raise_uncaught_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
+    raise exc
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
+    response = handler(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/middleware/rolecontrol.py", line 48, in __call__
+    return self.func(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/groupuserview.py", line 26, in get
+    users = users - group.users.all()
+TypeError: unsupported operand type(s) for -: 'QuerySet' and 'QuerySet'
+[ERROR] [2022-10-10 22:12:00,125] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/user HTTP/1.1" 500 100697
+[INFO] [2022-10-10 22:13:48,407] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/groupuserview.py changed, reloading.
+[INFO] [2022-10-10 22:13:48,709] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[ERROR] [2022-10-10 22:13:53,804] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/group/user
+Traceback (most recent call last):
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
+    response = get_response(request)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
+    response = wrapped_callback(request, *callback_args, **callback_kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
+    return view_func(*args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
+    return self.dispatch(request, *args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
+    response = self.handle_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
+    self.raise_uncaught_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
+    raise exc
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
+    response = handler(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/middleware/rolecontrol.py", line 48, in __call__
+    return self.func(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/groupuserview.py", line 27, in get
+    for user in group.users:
+TypeError: 'ManyRelatedManager' object is not iterable
+[ERROR] [2022-10-10 22:13:53,806] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/user HTTP/1.1" 500 100459
+[INFO] [2022-10-10 22:14:06,588] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/group/views/groupuserview.py changed, reloading.
+[INFO] [2022-10-10 22:14:06,876] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-10 22:14:08,950] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/user HTTP/1.1" 200 335
+[INFO] [2022-10-10 22:15:35,060] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group?manager_id=&user_id=TestLaboratory_V1_User_1 HTTP/1.1" 301 0
+[INFO] [2022-10-10 22:15:35,072] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/group/?manager_id=&user_id=TestLaboratory_V1_User_1 HTTP/1.1" 200 167
+[INFO] [2022-10-11 14:45:14,253] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/plan/views/planview.py changed, reloading.

+ 2 - 0
logs/all-2022-10-11.log

@@ -0,0 +1,2 @@
+[INFO] [2022-10-11 14:45:14,742] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-12 11:22:16,329] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/urls.py changed, reloading.

+ 84 - 0
logs/all-2022-10-12.log

@@ -0,0 +1,84 @@
+[INFO] [2022-10-12 11:22:16,700] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-12 11:30:16,138] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/views/userexportview.py changed, reloading.
+[INFO] [2022-10-12 11:30:16,433] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[WARNING] [2022-10-12 11:31:45,577] [log.py:224] [log:log_response] - Not Found: /api/v1/user/export
+[WARNING] [2022-10-12 11:31:45,578] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/user/export HTTP/1.1" 404 2967
+[WARNING] [2022-10-12 11:32:17,524] [log.py:224] [log:log_response] - Forbidden: /api/v1/users/export
+[WARNING] [2022-10-12 11:32:17,525] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/users/export HTTP/1.1" 403 43
+[INFO] [2022-10-12 11:32:33,754] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/views/userexportview.py changed, reloading.
+[INFO] [2022-10-12 11:32:34,063] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-12 11:32:35,833] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/users/export HTTP/1.1" 200 11264
+[INFO] [2022-10-12 11:33:03,025] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/users/export HTTP/1.1" 200 11264
+[INFO] [2022-10-12 11:33:32,589] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/views/userexportview.py changed, reloading.
+[INFO] [2022-10-12 11:33:32,909] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-12 11:33:37,324] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/users/export HTTP/1.1" 200 11264
+[INFO] [2022-10-12 11:34:38,119] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/views/userexportview.py changed, reloading.
+[INFO] [2022-10-12 11:34:38,431] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-12 15:05:08,044] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/views/userlistview.py changed, reloading.
+[INFO] [2022-10-12 15:05:08,367] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-12 21:23:53,103] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[ERROR] [2022-10-12 21:24:14,774] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/users/export
+Traceback (most recent call last):
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
+    response = get_response(request)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
+    response = wrapped_callback(request, *callback_args, **callback_kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
+    return view_func(*args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
+    return self.dispatch(request, *args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
+    response = self.handle_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
+    self.raise_uncaught_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
+    raise exc
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
+    response = handler(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/views/userexportview.py", line 45, in get
+    executor, action, method = get_log(request)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/log/models.py", line 55, in get_log
+    payload = jwt.decode(token, SALT, True)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/jwt/api_jwt.py", line 84, in decode
+    payload, _, _, _ = self._load(jwt)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/jwt/api_jws.py", line 176, in _load
+    raise DecodeError("Invalid token type. Token must be a {0}".format(
+jwt.exceptions.DecodeError: Invalid token type. Token must be a <class 'bytes'>
+[ERROR] [2022-10-12 21:24:14,779] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/users/export HTTP/1.1" 500 108551
+[INFO] [2022-10-12 21:24:28,602] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/views/userexportview.py changed, reloading.
+[INFO] [2022-10-12 21:24:28,923] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[WARNING] [2022-10-12 21:24:31,151] [log.py:224] [log:log_response] - Forbidden: /api/v1/users/export
+[WARNING] [2022-10-12 21:24:31,154] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/users/export HTTP/1.1" 403 43
+[INFO] [2022-10-12 21:24:40,596] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/views/userexportview.py changed, reloading.
+[INFO] [2022-10-12 21:24:40,918] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[ERROR] [2022-10-12 21:24:44,016] [log.py:224] [log:log_response] - Internal Server Error: /api/v1/users/export
+Traceback (most recent call last):
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
+    response = get_response(request)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
+    response = wrapped_callback(request, *callback_args, **callback_kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
+    return view_func(*args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
+    return self.dispatch(request, *args, **kwargs)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
+    response = self.handle_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
+    self.raise_uncaught_exception(exc)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
+    raise exc
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
+    response = handler(request, *args, **kwargs)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/views/userexportview.py", line 45, in get
+    executor, action, method = get_log(request)
+  File "/Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/log/models.py", line 55, in get_log
+    payload = jwt.decode(token, SALT, True)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/jwt/api_jwt.py", line 84, in decode
+    payload, _, _, _ = self._load(jwt)
+  File "/Users/liufan/program/software/python/miniforge3/lib/python3.9/site-packages/jwt/api_jws.py", line 176, in _load
+    raise DecodeError("Invalid token type. Token must be a {0}".format(
+jwt.exceptions.DecodeError: Invalid token type. Token must be a <class 'bytes'>
+[ERROR] [2022-10-12 21:24:44,021] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/users/export HTTP/1.1" 500 108551
+[INFO] [2022-10-12 21:25:21,634] [autoreload.py:251] [autoreload:trigger_reload] - /Users/liufan/program/PYTHON/TestLaboratoryGit/TestLaboratory/apps/user/views/userexportview.py changed, reloading.
+[INFO] [2022-10-12 21:25:22,002] [autoreload.py:637] [autoreload:run_with_reloader] - Watching for file changes with StatReloader
+[INFO] [2022-10-12 21:25:26,083] [basehttp.py:161] [basehttp:log_message] - "GET /api/v1/users/export HTTP/1.1" 200 11264

+ 0 - 0
logs/error-2022-10-04.log


+ 0 - 0
logs/error-2022-10-05.log


Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio