Skip to content

Commit

Permalink
Merge pull request #7948 from Gauravp-NEC/Fix-for-issue-7931
Browse files Browse the repository at this point in the history
Include `AttributeError` in the except handle of license retrieval
  • Loading branch information
amercader committed Nov 30, 2023
2 parents a92365d + f3870c5 commit 9bf033a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changes/7931.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Catch AttributeErrors in license retrieval.
2 changes: 1 addition & 1 deletion ckan/views/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def read(package_type: str, id: str, resource_id: str) -> Union[Response, str]:
try:
package[u'isopen'] = model.Package.get_license_register()[license_id
].isopen()
except KeyError:
except (KeyError, AttributeError):
package[u'isopen'] = False

resource_views = get_action(u'resource_view_list')(
Expand Down

0 comments on commit 9bf033a

Please sign in to comment.