You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create an organization field that is only editable by sysadmins. I don't care if org admins can see it, but I don't want them to be able to change it (or clear it). Here's my attempt at such a field:
But when I try to edit the organization as a non-sysadmin, I get this exception (I guess because the ignore_not_sysadmin validator deletes the key):
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/flask/app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python3.8/site-packages/flask/app.py", line 1935, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/lib/python3.8/site-packages/flask/views.py", line 89, in view
return self.dispatch_request(*args, **kwargs)
File "/usr/lib/python3.8/site-packages/flask/views.py", line 163, in dispatch_request
return meth(*args, **kwargs)
File "/srv/app/src/ckan/ckan/config/middleware/../../views/group.py", line 955, in post
group = _action(u'group_update')(context, data_dict)
File "/srv/app/src/ckan/ckan/logic/__init__.py", line 504, in wrapped
result = _action(context, data_dict, **kw)
File "/srv/app/src/ckan/ckan/logic/action/update.py", line 812, in organization_update
return _group_or_org_update(context, data_dict, is_org=True)
File "/srv/app/src/ckan/ckan/logic/action/update.py", line 684, in _group_or_org_update
data, errors = lib_plugins.plugin_validate(
File "/srv/app/src/ckan/ckan/lib/plugins.py", line 312, in plugin_validate
result = plugin.validate(context, data_dict, schema, action)
File "/srv/app/src/ckanext-scheming/ckanext/scheming/plugins.py", line 191, in validate
return navl_validate(data_dict, schema, context)
File "/srv/app/src/ckan/ckan/lib/navl/dictization_functions.py", line 285, in validate
converted_data, errors = _validate(flattened, schema, validators_context)
File "/srv/app/src/ckan/ckan/lib/navl/dictization_functions.py", line 335, in _validate
convert(converter, key, converted_data, errors, context)
File "/srv/app/src/ckan/ckan/lib/navl/dictization_functions.py", line 237, in convert
converter(key, converted_data, errors, context)
File "/srv/app/src/ckan/ckan/logic/converters.py", line 24, in convert_to_extras
data[('extras', new_index, 'value')] = data[key]
KeyError: ('forecast_daily_locations_limit',)
If I add ignore_missing to the validators, no exception is raised, but editing the org as an org admin clears the field.
Any way to accomplish this?
Thanks!
The text was updated successfully, but these errors were encountered:
I'm trying to create an organization field that is only editable by sysadmins. I don't care if org admins can see it, but I don't want them to be able to change it (or clear it). Here's my attempt at such a field:
But when I try to edit the organization as a non-sysadmin, I get this exception (I guess because the
ignore_not_sysadmin
validator deletes the key):If I add
ignore_missing
to the validators, no exception is raised, but editing the org as an org admin clears the field.Any way to accomplish this?
Thanks!
The text was updated successfully, but these errors were encountered: