Skip to content

Commit

Permalink
YDA-5992: fix urllib quoting
Browse files Browse the repository at this point in the history
  • Loading branch information
lwesterhof committed Dec 3, 2024
1 parent 72a31af commit 2943ea7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import random
import string
import time
import urllib
import urllib.parse
from datetime import datetime, timedelta

import genquery
Expand Down Expand Up @@ -86,10 +86,10 @@ def api_notifications_load(ctx, sort_order="desc"):
space, _, group, subpath = pathutil.info(notification["target"])
if space is pathutil.Space.RESEARCH:
notification["data_package"] = group if subpath == '' else pathutil.basename(subpath)
notification["link"] = "/research/browse?dir=" + urllib.quote("/{}/{}".format(group, subpath))
notification["link"] = "/research/browse?dir=" + urllib.parse.quote(f"/{group}/{subpath}")
elif space is pathutil.Space.VAULT:
notification["data_package"] = group if subpath == '' else pathutil.basename(subpath)
notification["link"] = "/vault/browse?dir=" + urllib.quote("/{}/{}".format(group, subpath))
notification["link"] = "/vault/browse?dir=" + urllib.parse.quote(f"/{group}/{subpath}")

# Deposit situation required different information to be presented.
if subpath.startswith('deposit-'):
Expand Down

0 comments on commit 2943ea7

Please sign in to comment.