Skip to content

Commit 64ca18b

Browse files
committed
Fix (xs): Allow download access for incomplete accout as well
1 parent 4102764 commit 64ca18b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

ckanext/oauth2/plugin.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,13 @@ def _allowed_endpoint(endpoint):
165165
toolkit.h.flash_notice(
166166
toolkit._("Please complete your account setup.")
167167
)
168-
response.headers["Location"] = toolkit.url_for(
169-
"oauth2.account_update"
170-
)
171-
response.status_code = 302
168+
if toolkit.request.endpoint == "approval_dataset.download_resource":
169+
return response
170+
else:
171+
response.headers["Location"] = toolkit.url_for(
172+
"oauth2.account_update"
173+
)
174+
response.status_code = 302
172175
return response
173176
elif account_state == "pending":
174177
if toolkit.request.endpoint == "approval_dataset.download_resource":

0 commit comments

Comments
 (0)