Skip to content

Commit

Permalink
Merge pull request #21 from salsadigitalauorg/uat
Browse files Browse the repository at this point in the history
CKAN 2.10 Upgrade
  • Loading branch information
MarkCalvert authored Oct 30, 2024
2 parents 9e6746d + 87d0a89 commit d418f59
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ckanext/relationships/logic/auth/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def package_relationship_create(context, data_dict):
# to the subject package that they were updating (i.e. the package they
# DO have `package_update` permission for.
#
if roles_allowed and authz.auth_is_loggedin_user:
if roles_allowed and not toolkit.current_user.is_anonymous:
# On new datasets the context.get('package') has not been set yet, so need to use package_show for the subject
# data_dict['subject'] is always the ID of the package being created/updated
context_package = toolkit.get_action('package_show')(context, {"id": data_dict['subject']})
Expand Down
4 changes: 2 additions & 2 deletions ckanext/relationships/templates/package/relationships.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h3>CKAN dataset to dataset relationship</h3>
{% if relatable_datasets %}

<form action="/dataset/{{ pkg_dict['name'] }}/relationships/create" method="post">

{{ h.csrf_input() }}
This dataset <select name="type">
{% for option in h.get_relationship_types() %}
<option value="{{ option[0] }}">{{ option[0] }}</option>
Expand All @@ -77,7 +77,7 @@ <h4>There are no other datasets to link to.</h4>
<h3>CKAN dataset to external URI relationship</h3>

<form action="/dataset/{{ pkg_dict['name'] }}/relationships/create" method="post">

{{ h.csrf_input() }}
This dataset <select name="type">
{% for option in h.get_relationship_types() %}
<option value="{{ option[0] }}">{{ option[0] }}</option>
Expand Down

0 comments on commit d418f59

Please sign in to comment.