Skip to content

Commit

Permalink
Merge branch 'feat--generate-article-summaries-with-chat-gpt' of gith…
Browse files Browse the repository at this point in the history
…ub.com:2077-Collective/2077-CMS into feat--generate-article-summaries-with-chat-gpt
  • Loading branch information
iankressin committed Dec 12, 2024
2 parents b015690 + 90e6547 commit 182edbb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/apps/research/admin/article_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ def generate_summary_view(self, request):
gpt_summary = asyncio.run(self._generate_summary(content))
return JsonResponse({'summary': gpt_summary})
except Exception as e:
return JsonResponse({'error': str(e)}, status=500)
import logging
logging.error("An error occurred while generating the summary", exc_info=True)
return JsonResponse({'error': 'An internal error has occurred!'}, status=500)
return JsonResponse({'error': 'Invalid request method'}, status=400)

def current_slug_history(self, obj):
Expand Down

0 comments on commit 182edbb

Please sign in to comment.