Skip to content

Commit

Permalink
Fix contact action
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Jan 23, 2025
1 parent 0d35cd4 commit 459f656
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rdmo/projects/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ def visibility(self, request, pk=None):
permission_classes=(HasModelPermission | HasProjectPermission, ))
def contact(self, request, pk):
if settings.PROJECT_CONTACT:
project = self.get_object()
if request.method == 'POST':
subject = request.data.get('subject')
message = request.data.get('message')
Expand All @@ -345,11 +346,10 @@ def contact(self, request, pk):
'message': [_('This field may not be blank.')] if not message else []
})
else:
project = self.get_object()
project.catalog.prefetch_elements()
return Response(get_contact_message(request, project))
else:
return 404
raise Http404

@action(detail=False, url_path='upload-accept', permission_classes=(IsAuthenticated, ))
def upload_accept(self, request):
Expand Down

0 comments on commit 459f656

Please sign in to comment.