From 2ca250760c291f38978ef8d7ae56d9e9cb258fcf Mon Sep 17 00:00:00 2001 From: AtmegaBuzz Date: Thu, 15 Dec 2022 00:22:25 +0530 Subject: [PATCH 1/2] automerge fixed --- .github/workflows/auto-merge.yml | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index 3554b67aa..1bf8aac90 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -1,13 +1,29 @@ -name: auto-merge +name: automerge on: pull_request: - + types: + - labeled + - unlabeled + - synchronize + - opened + - edited + - ready_for_review + - reopened + - unlocked + pull_request_review: + types: + - submitted + check_suite: + types: + - completed + status: {} jobs: - auto-merge: + automerge: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: ahmadnassri/action-dependabot-auto-merge@v2 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} + - id: automerge + name: automerge + uses: "pascalgn/automerge-action@v0.15.5" + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file From cf59af525cb686bab22284b92be806da15f62138 Mon Sep 17 00:00:00 2001 From: AtmegaBuzz Date: Thu, 15 Dec 2022 20:07:50 +0530 Subject: [PATCH 2/2] Fix server error on issues repored by anynomous users --- website/api/views.py | 51 +++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/website/api/views.py b/website/api/views.py index d898a759b..356a0fb17 100644 --- a/website/api/views.py +++ b/website/api/views.py @@ -154,30 +154,33 @@ def post(self,request,id,format=None,*args,**kwargs): liked_user = issue.user liker_user = request.user issue_pk = issue.pk - msg_plain = render_to_string( - "email/issue_liked.txt", - { - "liker_user": liker_user.username, - "liked_user": liked_user.username, - "issue_pk": issue_pk, - }, - ) - msg_html = render_to_string( - "email/issue_liked.txt", - { - "liker_user": liker_user.username, - "liked_user": liked_user.username, - "issue_pk": issue_pk, - }, - ) - - send_mail( - "Your issue got an upvote!!", - msg_plain, - "Bugheist ", - [liked_user.email], - html_message=msg_html, - ) + + if liked_user: + + msg_plain = render_to_string( + "email/issue_liked.txt", + { + "liker_user": liker_user.username, + "liked_user": liked_user.username, + "issue_pk": issue_pk, + }, + ) + msg_html = render_to_string( + "email/issue_liked.txt", + { + "liker_user": liker_user.username, + "liked_user": liked_user.username, + "issue_pk": issue_pk, + }, + ) + + send_mail( + "Your issue got an upvote!!", + msg_plain, + "Bugheist ", + [liked_user.email], + html_message=msg_html, + ) return Response({"issue":"liked"})