Skip to content

Commit

Permalink
Fix missing name when uploading publication
Browse files Browse the repository at this point in the history
  • Loading branch information
kovacspe committed Apr 12, 2024
1 parent 4f124af commit 4a11134
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion competition/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,14 +908,15 @@ def upload_publication(self, request: Request):
publication = Publication.objects.filter(
event=event, order=order).first()
if publication is None:
publication = Publication.objects.create(
publication = Publication(
name=request.data.get('name'),
file=file,
event=event,
order=order,
publication_type=publication_type
)
publication.generate_name()
publication.save()

publication.file.save(publication.name, file)
return Response(status=status.HTTP_201_CREATED)
Expand Down

0 comments on commit 4a11134

Please sign in to comment.