Skip to content

Commit

Permalink
[issue-update][s]: pagination issue resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
sneha-sharma12 committed Jul 4, 2024
1 parent fe6d65f commit 0fbfde2
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions ckanext/ubdc/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import ckan.lib.navl.dictization_functions as dict_fns
import ckan.lib.captcha as captcha


tuplize_dict = logic.tuplize_dict
clean_dict = logic.clean_dict
parse_params = logic.parse_params
Expand All @@ -24,6 +23,14 @@

ubdc = Blueprint("ubdc", __name__)

def get_path(path, query_type, toolkit):
original_query = toolkit.request.query_string.decode("utf-8")
if original_query:
target_url = "/" + query_type + "/" + path + '?' + original_query
else:
target_url = "/" + query_type + "/" + path
return target_url

# Redirect organization pages to provider pages
provider = Blueprint(
"provider",
Expand Down Expand Up @@ -60,7 +67,8 @@ def org_redirect_root():

@ubdc.route("/organization/<path:path>")
def org_redirect(path):
return redirect("/providers/{}".format(path))
url = get_path(path, 'providers', tk)
return redirect(url)

@ubdc.route("/group/")
def group_redirect_root():
Expand All @@ -69,7 +77,8 @@ def group_redirect_root():

@ubdc.route("/group/<path:path>")
def group_redirect(path):
return redirect("/research-themes/{}".format(path))
url = get_path(path, 'research-themes', tk)
return redirect(url)

@ubdc.route("/dataset")
@ubdc.route("/dataset/")
Expand All @@ -84,7 +93,8 @@ def dataset_redirect_root():

@ubdc.route("/dataset/<path:path>")
def dataset_redirect(path):
return redirect("/datasets/{}".format(path))
url = get_path(path, 'datasets', tk)
return redirect(url)


class AccessRequestController(MethodView):
Expand Down

0 comments on commit 0fbfde2

Please sign in to comment.