Skip to content

Commit

Permalink
views: ignore extraneous kwargs
Browse files Browse the repository at this point in the history
pass_* decorators pass through kwargs as later pass_* might need them
orginal kwargs come from URL-parsing, new ones might get added anytime
such new kwargs aren't ignored by view-functions, causing calls to fail
such failed calls have been a common issue recently
this preempts future such failed calls by ignoring extraneous kwargs
  • Loading branch information
martinobersteiner committed Nov 13, 2024
1 parent f9a9100 commit e945be3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions invenio_records_lom/ui/records/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def record_detail(
files: FileList | None = None,
*,
include_deleted: bool = False,
**__, # noqa: ANN003
) -> str:
"""Record detail page (aka landing page)."""
files_dict = {} if files is None else files.to_dict()
Expand Down Expand Up @@ -139,6 +140,7 @@ def record_export(
pid_value: str | None = None,
*,
is_preview: bool | None = False, # noqa: ARG001
**__, # noqa: ANN003
) -> tuple[dict, int, dict]:
"""Export view for LOM records."""
exporter = current_app.config.get("LOM_RECORD_EXPORTERS", {}).get(export_format)
Expand Down Expand Up @@ -201,6 +203,7 @@ def record_file_download( # noqa: ANN201
filename: str | None = None, # noqa: ARG001
*,
is_preview: bool = False, # noqa: ARG001
**__, # noqa: ANN003
):
"""Download a file from a record."""
# emit a file download stats event
Expand All @@ -223,6 +226,7 @@ def record_file_download( # noqa: ANN201
@pass_record_latest
def record_latest( # noqa: ANN201
record: RecordItem = None,
**__, # noqa: ANN003
):
"""Redirect to record's landing page."""
return redirect(record["links"]["self_html"], code=302)
Expand Down

0 comments on commit e945be3

Please sign in to comment.