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, existing users haven't set the verified_at property. This leads to community page being broken.
Expected behavior
Add script to update all users, with a verified_at={True, False} as part of the upgrade script.
Additional context
Relevant stacktrace
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:
zzacharo
changed the title
v12-upgrade: community results in 500 if existing members have not set verified_at
v12-upgrade: community gives 500 if existing members have not set verified_at
Apr 5, 2024
Package version (if known): v12.0.0.0b3.x
Describe the bug
WHen upgrading to v12, existing users haven't set the
verified_at
property. This leads to community page being broken.Expected behavior
Add script to update all users, with a verified_at={True, False} as part of the upgrade script.
Additional context
Relevant stacktrace
The text was updated successfully, but these errors were encountered: