Skip to content

Commit

Permalink
Merge pull request #85 from TsimpDim/Fix-sharing-bug
Browse files Browse the repository at this point in the history
Fix being unable to open share links
  • Loading branch information
TsimpDim committed Nov 23, 2018
2 parents 553eae7 + 1f26931 commit 49ccb10
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions _3RStore/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1011,8 +1011,8 @@ def reset_w_token(token):
def share():

if(request.method == 'POST'):
tags = request.form.get('tags')
tags = [t.lower() for t in tags.split(',')]
tags_str = request.form.get('tags')
tags = [t.lower() for t in tags_str.split(',')]

if not tags:
flash('No tags selected. Can\'t share.', 'danger')
Expand Down Expand Up @@ -1043,10 +1043,10 @@ def share():

share_url = url_for(
'open_share',
token = serializer.dumps([session['user_id'],tags], salt='share-salt'),
token = serializer.dumps([session['user_id'],tags_str], salt='share-salt'),
_external=True)

message = Markup("Resources containing {" + ','.join(tags) + "} can be publicly accessed for 3 days via the following link: <a href=" + share_url + ">Link</a>")
message = Markup("Resources containing {" + tags_str + "} can be publicly accessed for 3 days via the following link: <a href=" + share_url + ">Link</a>")
flash(message, 'info')

return redirect(url_for('resources'))
Expand Down

0 comments on commit 49ccb10

Please sign in to comment.