Skip to content

Commit

Permalink
Pridaná možnosť pomenovať publikáciu
Browse files Browse the repository at this point in the history
  • Loading branch information
kovacspe committed Dec 8, 2023
1 parent 0bb0a06 commit f133539
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion competition/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ def generate_name(self, forced=False):
if self.order:
self.name = f'{self.order}'
else:
self.name = type.name
self.name = self.publication_type.name
self.save()

def __str__(self):
Expand Down
3 changes: 2 additions & 1 deletion competition/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ def download_publication(self, request, pk=None):
return response

@action(methods=['post'], detail=False, url_path='upload', permission_classes=[IsAdminUser])
def upload_publication(self, request):
def upload_publication(self, request: Request):
"""Nahrá súbor publikácie"""
if 'file' not in request.data:
raise exceptions.ParseError(detail='Request neobsahoval súbor')
Expand All @@ -868,6 +868,7 @@ def upload_publication(self, request):
event=event, order=order).first()
if publication is None:
publication = Publication.objects.create(
name=request.data.get('name'),
file=file,
event=event,
order=order,
Expand Down

0 comments on commit f133539

Please sign in to comment.