Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pridaná možnosť pomenovať publikáciu #300

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading