Merge branch 'master' of https://e.coding.net/ctcdevteam/cma_search
This commit is contained in:
commit
8d602b1cec
|
@ -12,6 +12,7 @@ from rest_framework.permissions import AllowAny
|
|||
from apps.edu.services import make_img_x
|
||||
from django.db import transaction
|
||||
import datetime
|
||||
from django.db.models import Q
|
||||
|
||||
|
||||
# Create your views here.
|
||||
|
@ -123,3 +124,15 @@ class CertificateViewSet(CreateUpdateCustomMixin, ModelViewSet):
|
|||
obj.课程列表.set(Course.objects.filter(id__in=courses_list))
|
||||
i += 1
|
||||
return Response()
|
||||
|
||||
@action(methods=["get"], detail=False, perms_map={"get": "*"})
|
||||
def gen_img(self, request, *args, **kwargs):
|
||||
"""没有生成证书照片的都生成照片
|
||||
|
||||
没有生成证书照片的都生成照片
|
||||
"""
|
||||
queryset = Certificate.objects.filter(Q(证书地址=None) | Q(证书地址=""))
|
||||
for obj in queryset:
|
||||
make_img_x(obj)
|
||||
print(f"生成---{obj.姓名}---的证书")
|
||||
return Response()
|
||||
|
|
Loading…
Reference in New Issue