Skip to content

Commit

Permalink
stats: replace files rest file download event receiver
Browse files Browse the repository at this point in the history
  • Loading branch information
kpsherva committed Feb 19, 2024
1 parent a26320a commit aaaecef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion invenio_app_ils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ def _(x):
# =====
STATS_EVENTS = {
"file-download": {
"signal": "invenio_files_rest.signals.file_downloaded",
"signal": "invenio_app_ils.signals.file_downloaded",
"templates": "invenio_app_ils.stats.file_download",
"event_builders": [
"invenio_app_ils.eitems.api:eitem_event_builder",
Expand Down
4 changes: 1 addition & 3 deletions invenio_app_ils/records/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from flask import Blueprint, abort, current_app, request
from flask_login import current_user
from invenio_files_rest.models import ObjectVersion
from invenio_files_rest.signals import file_downloaded
from invenio_records_rest.utils import obj_or_import_string
from invenio_records_rest.views import pass_record
from invenio_rest import ContentNegotiatedMethodView
Expand All @@ -21,7 +20,7 @@
from invenio_app_ils.permissions import backoffice_permission
from invenio_app_ils.records.permissions import RecordPermission
from invenio_app_ils.series.api import SERIES_PID_TYPE
from invenio_app_ils.signals import record_viewed
from invenio_app_ils.signals import record_viewed, file_downloaded


def create_document_stats_blueprint(app):
Expand Down Expand Up @@ -67,7 +66,6 @@ def post(self, pid, record, **kwargs):
if not current_user.is_authenticated:
abort(401)
abort(403)

data = request.get_json()
event_name = data.get("event")
if event_name == "record-view":
Expand Down

0 comments on commit aaaecef

Please sign in to comment.