Skip to content

Commit

Permalink
fix(social- share bug fix):fix bug for authenticated users to be able…
Browse files Browse the repository at this point in the history
… to share an article via email.

… Remove trailing slash at the end of the email link in the EmailShareView.

[Finishes #162163182]
  • Loading branch information
Ayesiga Lindsey Patra authored and Innocent Asiimwe committed Dec 22, 2018
1 parent 51705c2 commit c20694e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions authors/apps/articles/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,15 +447,15 @@ def post(self, request, slug):

Article.objects.get(slug=slug)

current_site = 'http://{}'.format(get_current_site(request))
current_site = 'https://{}'.format(get_current_site(request))
route = 'api/articles'
url = "{}/{}/{}".format(current_site, route, slug)

from_email = os.environ.get(
"EMAIL_HOST_USER", "seven.zeusgeek@gmail.com")
recipient = request.user.email
subject = "Authors Haven"
body = "Click here to enjoy the article {}/".format(url)
body = "Click here to enjoy the article {}".format(url)
send_mail(subject, body, from_email, [recipient], fail_silently=False)

return Response(
Expand Down

0 comments on commit c20694e

Please sign in to comment.