Skip to content

Commit

Permalink
Handle html content
Browse files Browse the repository at this point in the history
  • Loading branch information
Shruti1229 committed Nov 21, 2023
1 parent 5a76508 commit dbeae64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/newsletter/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ def create(self, request, pk=None, *args, **kwargs):
html_file = loader.get_template(requested_html)
html_content = html_file.render(context, request)
elif template_id == 3:
if len(content) != 0:
message = base64.b64decode(content).decode("utf-8")
if type(content) == dict:
message = base64.b64decode(content["html"]).decode("utf-8")
f = open('content.html','w')
f.write(message)
f.close()
Expand Down

0 comments on commit dbeae64

Please sign in to comment.