Skip to content

Commit

Permalink
Fix server error on issues repored by anynomous users and Fix auto me…
Browse files Browse the repository at this point in the history
…rge (#1002)

* automerge fixed

* Fix server error on issues repored by anynomous users
  • Loading branch information
AtmegaBuzz authored Dec 15, 2022
1 parent ca37629 commit c8cea55
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 31 deletions.
30 changes: 23 additions & 7 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -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 }}"
51 changes: 27 additions & 24 deletions website/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <support@bugheist.com>",
[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 <support@bugheist.com>",
[liked_user.email],
html_message=msg_html,
)

return Response({"issue":"liked"})

Expand Down

0 comments on commit c8cea55

Please sign in to comment.