diff --git a/api/v1/views.py b/api/v1/views.py index 62b3725e..cfe857fb 100644 --- a/api/v1/views.py +++ b/api/v1/views.py @@ -477,7 +477,8 @@ class ContestWorkViewSet(ExtendedModelViewSet): authentication_classes = [] def create(self, request, *args, **kwargs): - # FIXME in prod: fixed - if ContestWork.objects.filter(user=request.user).exists(): + # FIXME + user = User.objects.get(pk=request.data.get('user')) + if ContestWork.objects.filter(user=user).exists(): return Response(status=status.HTTP_400_BAD_REQUEST) return super().create(request, *args, **kwargs) diff --git a/apps/content/templates/content/contest.html b/apps/content/templates/content/contest.html index 0574ca48..f37f3886 100644 --- a/apps/content/templates/content/contest.html +++ b/apps/content/templates/content/contest.html @@ -12,9 +12,11 @@ {{ contest.description }}
- - Загрузить свою работу + {% if not contest_work_uploaded %} + Загрузить свою работу + {% endif %}
@@ -32,9 +34,11 @@
Галерея
- Загрузить свою работу + {% endif %}