Add course
This commit is contained in:
parent
d409f0e9b4
commit
83579891b9
27 changed files with 1308 additions and 484 deletions
|
@ -19,15 +19,14 @@ def vote_problem(request):
|
|||
except Exception as e:
|
||||
return HttpResponseBadRequest()
|
||||
|
||||
with transaction.atomic():
|
||||
vote, _ = VolunteerProblemVote.objects.get_or_create(
|
||||
voter=request.profile,
|
||||
problem=problem,
|
||||
defaults={"knowledge_points": 0, "thinking_points": 0},
|
||||
)
|
||||
vote.knowledge_points = knowledge_points
|
||||
vote.thinking_points = thinking_points
|
||||
vote.feedback = feedback
|
||||
vote.types.set(types)
|
||||
vote.save()
|
||||
vote, _ = VolunteerProblemVote.objects.get_or_create(
|
||||
voter=request.profile,
|
||||
problem=problem,
|
||||
defaults={"knowledge_points": 0, "thinking_points": 0},
|
||||
)
|
||||
vote.knowledge_points = knowledge_points
|
||||
vote.thinking_points = thinking_points
|
||||
vote.feedback = feedback
|
||||
vote.types.set(types)
|
||||
vote.save()
|
||||
return JsonResponse({})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue