Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecation warnings from marshmallow #214

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions invenio_oaiserver/verbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@ class ListIdentifiers(OAISchema):
"""Arguments for ListIdentifiers verb."""

from_ = DateTime(
format='permissive', load_from='from',
data_key='from', dump_to='from')
format='permissive',
metadata={'load_from': 'from', 'data_key': 'from', 'dump_to': 'from'},
)
until = DateTime(format='permissive')
set = fields.Str()
metadataPrefix = fields.Str(required=True,
Expand Down Expand Up @@ -160,8 +161,8 @@ class ListSets(OAISchema, ResumptionTokenSchema):
def check_extra_params_in_request(verb):
"""Check for extra arguments in incomming request."""
extra = set(request.values.keys()) - set([
getattr(f, 'load_from', None) or getattr(
f, 'data_key', None) or f.name for f in verb.fields.values()
f.metadata.get('load_from', None) or f.metadata
.get('data_key', None) or f.name for f in verb.fields.values()
])
if extra:
raise ValidationError({'_schema': ['You have passed too many arguments.']})
Expand Down