diff --git a/test_client/src/views/youpei/index.vue b/test_client/src/views/youpei/index.vue index d1337ee..4368328 100644 --- a/test_client/src/views/youpei/index.vue +++ b/test_client/src/views/youpei/index.vue @@ -98,8 +98,8 @@ { this.$refs.commonForm && this.$refs.commonForm.clearValidate() }) diff --git a/test_server/cms/migrations/0021_auto_20250422_1015.py b/test_server/cms/migrations/0021_auto_20250422_1015.py new file mode 100644 index 0000000..fa36afe --- /dev/null +++ b/test_server/cms/migrations/0021_auto_20250422_1015.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2.12 on 2025-04-22 02:15 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cms', '0020_auto_20250417_1538'), + ] + + operations = [ + migrations.AlterField( + model_name='companyinfo', + name='remark', + field=models.TextField(blank=True, max_length=5000, null=True, verbose_name='备注'), + ), + migrations.AlterField( + model_name='userpz', + name='art_remark', + field=models.TextField(blank=True, max_length=5000, null=True, verbose_name='备注'), + ), + ] diff --git a/test_server/cms/models.py b/test_server/cms/models.py index 47163ad..609552c 100644 --- a/test_server/cms/models.py +++ b/test_server/cms/models.py @@ -68,7 +68,7 @@ class Threshold(CommonModel): class Userpz(CommonModel): art_name = models.CharField('姓名', max_length=50) art_photo = models.CharField('照片', max_length=100) - art_remark = models.TextField('备注', null=True, blank=True, max_length=1000) + art_remark = models.TextField('备注', null=True, blank=True, max_length=5000) def __str__(self): return self.art_name @@ -80,7 +80,7 @@ class CompanyInfo(CommonModel): co_sponsor_points = models.FloatField('协办大赛积分', null=True, blank=True) sum_points = models.FloatField('总积分', null=True, blank=True) photo = models.CharField('公司图片', null=True, blank=True, max_length=100) - remark = models.TextField('备注', null=True, blank=True, max_length=1000) + remark = models.TextField('备注', null=True, blank=True, max_length=5000) def __str__(self): return self.company_name diff --git a/test_server/examtest/views.py b/test_server/examtest/views.py index 29cfdce..0ec8532 100644 --- a/test_server/examtest/views.py +++ b/test_server/examtest/views.py @@ -39,6 +39,7 @@ from django.db import transaction from examtest.exports import gen_candidate from .services import issue from django.db import transaction +from server import conf # Create your views here. class ExamViewSet(ModelViewSet): @@ -97,12 +98,13 @@ class ExamViewSet(ModelViewSet): instance.delete() return Response(status=status.HTTP_204_NO_CONTENT) - + @action(methods=['post'], detail = False,perms_map=[{'post':'exam_attend'}]) def attend(self, request, *args, **kwargs): """ 参加考试 """ + exam_chance = getattr(conf, 'exam_chance', 3) consumer = request.user if request.data.get('deptname', None): consumer.deptname = request.data['deptname'] @@ -115,7 +117,7 @@ class ExamViewSet(ModelViewSet): if exam.only_vip and consumer.role.name != '培训班学员': return Response({'error':'您无法参加本场考试'}) tests = ExamTest.objects.filter(exam=exam, consumer=consumer) - if tests.count() < exam.chance: # 还有考试机会就可以接着考 + if tests.count() < exam_chance: # 还有考试机会就可以接着考 return Response({'exam':exam.pk}) return Response({'error':'考试机会不足'}) except: