Skip to content

Commit

Permalink
templates: add deprecation warning about search templates
Browse files Browse the repository at this point in the history
  • Loading branch information
zzacharo committed Jul 18, 2024
1 parent 4664a57 commit 9432027
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions invenio_stats/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

"""Celery background tasks."""

from warnings import warn

from flask import current_app

from .proxies import current_stats
Expand All @@ -29,6 +31,11 @@ def register_templates():
"""Register search templates for events."""
if current_app.config["STATS_REGISTER_INDEX_TEMPLATES"]:
return []
warn(
"Search templates are deprecated."
"In future releases, we will migrate to search index_templates.",
DeprecationWarning,
)
return _collect_templates()


Expand Down

0 comments on commit 9432027

Please sign in to comment.