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
When upgrading to v12, communities having an owner a group fail to be displayed. If the first owner is a user then a group can be added as an owner. This happens because groups do not have a verified_at column, so it fails here.
Expected behavior
We should make the code more resilient and allow groups to be the only owners of a community.
Additional context
Relevant exception
KeyError: 'is_verified'
File "marshmallow/utils.py", line 293, in _get_value_for_key
return obj[key]
KeyError: 'user'
File "flask/app.py", line 2529, in wsgi_app
response = self.full_dispatch_request()
File "flask/app.py", line 1825, in full_dispatch_request
rv = self.handle_user_exception(e)
File "flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "invenio_communities/views/decorators.py", line 32, in view
request.community = community.to_dict()
File "invenio_communities/communities/services/results.py", line 116, in to_dict
res = self.data
File "invenio_records_resources/services/records/results.py", line 71, in data
self._data = self._schema.dump(
File "invenio_records_resources/services/records/schema.py", line 105, in dump
return self.schema(context=context, **schema_args).dump(data)
File "marshmallow/schema.py", line 549, in dump
result = self._serialize(processed_obj, many=many)
File "marshmallow/schema.py", line 517, in _serialize
value = field_obj.serialize(attr_name, obj, accessor=self.get_attribute)
File "marshmallow/fields.py", line 332, in serialize
value = self.get_value(obj, attr, accessor=accessor)
File "marshmallow/fields.py", line 263, in get_value
return accessor_func(obj, check_key, default)
File "marshmallow/schema.py", line 476, in get_attribute
return get_value(obj, attr, default)
File "marshmallow/utils.py", line 276, in get_value
return _get_value_for_key(obj, key, default)
File "marshmallow/utils.py", line 295, in _get_value_for_key
return getattr(obj, key, default)
File "invenio_records_resources/records/systemfields/calculated.py", line 47, in __get__
return self.obj(record)
File "invenio_records_resources/records/systemfields/calculated.py", line 29, in obj
return self.calculate(instance)
File "invenio_communities/communities/records/systemfields/is_verified.py", line 28, in calculate
if owner["user"]["verified_at"] is not None:
The text was updated successfully, but these errors were encountered:
Package version (if known): v12.0.0.0b3.x
Describe the bug
When upgrading to v12, communities having an owner a group fail to be displayed. If the first owner is a user then a group can be added as an owner. This happens because groups do not have a
verified_at
column, so it fails here.Expected behavior
We should make the code more resilient and allow groups to be the only owners of a community.
Additional context
Relevant exception
The text was updated successfully, but these errors were encountered: