From 7a5cad9436fa712ebe0d21a86f67a440f5f9e391 Mon Sep 17 00:00:00 2001 From: Aga Date: Mon, 20 Nov 2023 13:45:46 +0000 Subject: [PATCH] change naming convention from GA_ to PLAUSIBLE_ --- portality/view/api_v1.py | 34 +++++++++++++++++----------------- portality/view/api_v2.py | 34 +++++++++++++++++----------------- portality/view/api_v3.py | 36 ++++++++++++++++++------------------ 3 files changed, 52 insertions(+), 52 deletions(-) diff --git a/portality/view/api_v1.py b/portality/view/api_v1.py index 783d724d4d..167e913436 100644 --- a/portality/view/api_v1.py +++ b/portality/view/api_v1.py @@ -11,8 +11,8 @@ API_VERSION_NUMBER = '1.0.0' # Google Analytics category for API events -GA_CATEGORY = app.config.get('PLAUSIBLE_CATEGORY_API', 'API Hit') -GA_ACTIONS = app.config.get('PLAUSIBLE_ACTIONS_API', {}) +PLAUSIBLE_CATEGORY = app.config.get('PLAUSIBLE_CATEGORY_API', 'API Hit') +PLAUSIBLE_ACTIONS = app.config.get('PLAUSIBLE_ACTIONS_API', {}) API_UNSUPPORTED_ERROR = "Version 1 is no longer supported." @@ -44,7 +44,7 @@ def search_articles(search_query): @blueprint.route("/articles", methods=["POST"]) @api_key_required @write_required(api=True) -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('create_article', 'Create article')) +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('create_article', 'Create article')) def create_article(): # Redirects are disabled https://github.com/DOAJ/doajPM/issues/2664 # return redirect(url_for('api_v3.create_article', **request.args), code=301) @@ -53,7 +53,7 @@ def create_article(): @blueprint.route("/articles/", methods=["GET"]) @api_key_optional -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('retrieve_article', 'Retrieve article'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('retrieve_article', 'Retrieve article'), record_value_of_which_arg='article_id') def retrieve_article(article_id): # Redirects are disabled https://github.com/DOAJ/doajPM/issues/2664 @@ -64,7 +64,7 @@ def retrieve_article(article_id): @blueprint.route("/articles/", methods=["PUT"]) @api_key_required @write_required(api=True) -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('update_article', 'Update article'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('update_article', 'Update article'), record_value_of_which_arg='article_id') def update_article(article_id): # Redirects are disabled https://github.com/DOAJ/doajPM/issues/2664 @@ -75,7 +75,7 @@ def update_article(article_id): @blueprint.route("/articles/", methods=["DELETE"]) @api_key_required @write_required(api=True) -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('delete_article', 'Delete article'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('delete_article', 'Delete article'), record_value_of_which_arg='article_id') def delete_article(article_id): # Redirects are disabled https://github.com/DOAJ/doajPM/issues/2664 @@ -86,7 +86,7 @@ def delete_article(article_id): @blueprint.route("/bulk/articles", methods=["POST"]) @api_key_required @write_required(api=True) -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('bulk_article_create', 'Bulk article create')) +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('bulk_article_create', 'Bulk article create')) def bulk_article_create(): # Redirects are disabled https://github.com/DOAJ/doajPM/issues/2664 # return redirect(url_for('api_v3.bulk_article_create', **request.args), code=301) @@ -96,7 +96,7 @@ def bulk_article_create(): @blueprint.route("/bulk/articles", methods=["DELETE"]) @api_key_required @write_required(api=True) -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('bulk_article_delete', 'Bulk article delete')) +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('bulk_article_delete', 'Bulk article delete')) def bulk_article_delete(): # Redirects are disabled https://github.com/DOAJ/doajPM/issues/2664 # return redirect(url_for('api_v3.bulk_article_delete', **request.args), code=301) @@ -108,7 +108,7 @@ def bulk_article_delete(): @blueprint.route('/journals/', methods=['GET']) @api_key_optional -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('retrieve_journal', 'Retrieve journal'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('retrieve_journal', 'Retrieve journal'), record_value_of_which_arg='journal_id') def retrieve_journal(journal_id): raise Api400Error(API_UNSUPPORTED_ERROR) @@ -117,7 +117,7 @@ def retrieve_journal(journal_id): @blueprint.route("/bulk/applications", methods=["POST"]) @api_key_required @write_required(api=True) -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('bulk_application_create', 'Bulk application create')) +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('bulk_application_create', 'Bulk application create')) def bulk_application_create(): raise Api400Error(API_UNSUPPORTED_ERROR) @@ -125,7 +125,7 @@ def bulk_application_create(): @blueprint.route("/bulk/applications", methods=["DELETE"]) @api_key_required @write_required(api=True) -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('bulk_application_delete', 'Bulk application delete')) +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('bulk_application_delete', 'Bulk application delete')) def bulk_application_delete(): raise Api400Error(API_UNSUPPORTED_ERROR) @@ -133,14 +133,14 @@ def bulk_application_delete(): @blueprint.route("/applications", methods=["POST"]) @api_key_required @write_required(api=True) -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('create_application', 'Create application')) +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('create_application', 'Create application')) def create_application(): raise Api400Error(API_UNSUPPORTED_ERROR) @blueprint.route("/applications/", methods=["GET"]) @api_key_required -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('retrieve_application', 'Retrieve application'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('retrieve_application', 'Retrieve application'), record_value_of_which_arg='application_id') def retrieve_application(application_id): raise Api400Error(API_UNSUPPORTED_ERROR) @@ -149,7 +149,7 @@ def retrieve_application(application_id): @blueprint.route("/applications/", methods=["PUT"]) @api_key_required @write_required(api=True) -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('update_application', 'Update application'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('update_application', 'Update application'), record_value_of_which_arg='application_id') def update_application(application_id): raise Api400Error(API_UNSUPPORTED_ERROR) @@ -158,7 +158,7 @@ def update_application(application_id): @blueprint.route("/applications/", methods=["DELETE"]) @api_key_required @write_required(api=True) -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('delete_application', 'Delete application'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('delete_application', 'Delete application'), record_value_of_which_arg='application_id') def delete_application(application_id): raise Api400Error(API_UNSUPPORTED_ERROR) @@ -166,14 +166,14 @@ def delete_application(application_id): @blueprint.route("/search/applications/") @api_key_required -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('search_applications', 'Search applications'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('search_applications', 'Search applications'), record_value_of_which_arg='search_query') def search_applications(search_query): raise Api400Error(API_UNSUPPORTED_ERROR) @blueprint.route('/search/journals/') -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('search_journals', 'Search journals'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('search_journals', 'Search journals'), record_value_of_which_arg='search_query') def search_journals(search_query): raise Api400Error(API_UNSUPPORTED_ERROR) diff --git a/portality/view/api_v2.py b/portality/view/api_v2.py index e3d636f75a..b8eb2e1b6e 100644 --- a/portality/view/api_v2.py +++ b/portality/view/api_v2.py @@ -11,8 +11,8 @@ API_VERSION_NUMBER = '2.0.0' # Google Analytics category for API events -GA_CATEGORY = app.config.get('PLAUSIBLE_CATEGORY_API', 'API Hit') -GA_ACTIONS = app.config.get('PLAUSIBLE_ACTIONS_API', {}) +PLAUSIBLE_CATEGORY = app.config.get('PLAUSIBLE_CATEGORY_API', 'API Hit') +PLAUSIBLE_ACTIONS = app.config.get('PLAUSIBLE_ACTIONS_API', {}) API_UNSUPPORTED_ERROR = "Version 2 is no longer supported." @@ -44,7 +44,7 @@ def search_articles(search_query): @blueprint.route("/articles", methods=["POST"]) @api_key_required @write_required(api=True) -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('create_article', 'Create article')) +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('create_article', 'Create article')) def create_article(): # Redirects are disabled https://github.com/DOAJ/doajPM/issues/2664 # return redirect(url_for('api_v3.create_article', **request.args), code=301) @@ -53,7 +53,7 @@ def create_article(): @blueprint.route("/articles/", methods=["GET"]) @api_key_optional -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('retrieve_article', 'Retrieve article'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('retrieve_article', 'Retrieve article'), record_value_of_which_arg='article_id') def retrieve_article(article_id): # Redirects are disabled https://github.com/DOAJ/doajPM/issues/2664 @@ -64,7 +64,7 @@ def retrieve_article(article_id): @blueprint.route("/articles/", methods=["PUT"]) @api_key_required @write_required(api=True) -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('update_article', 'Update article'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('update_article', 'Update article'), record_value_of_which_arg='article_id') def update_article(article_id): # Redirects are disabled https://github.com/DOAJ/doajPM/issues/2664 @@ -75,7 +75,7 @@ def update_article(article_id): @blueprint.route("/articles/", methods=["DELETE"]) @api_key_required @write_required(api=True) -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('delete_article', 'Delete article'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('delete_article', 'Delete article'), record_value_of_which_arg='article_id') def delete_article(article_id): # Redirects are disabled https://github.com/DOAJ/doajPM/issues/2664 @@ -86,7 +86,7 @@ def delete_article(article_id): @blueprint.route("/bulk/articles", methods=["POST"]) @api_key_required @write_required(api=True) -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('bulk_article_create', 'Bulk article create')) +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('bulk_article_create', 'Bulk article create')) def bulk_article_create(): # Redirects are disabled https://github.com/DOAJ/doajPM/issues/2664 # return redirect(url_for('api_v3.bulk_article_create', **request.args), code=301) @@ -96,7 +96,7 @@ def bulk_article_create(): @blueprint.route("/bulk/articles", methods=["DELETE"]) @api_key_required @write_required(api=True) -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('bulk_article_delete', 'Bulk article delete')) +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('bulk_article_delete', 'Bulk article delete')) def bulk_article_delete(): # Redirects are disabled https://github.com/DOAJ/doajPM/issues/2664 # return redirect(url_for('api_v3.bulk_article_delete', **request.args), code=301) @@ -108,7 +108,7 @@ def bulk_article_delete(): @blueprint.route('/journals/', methods=['GET']) @api_key_optional -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('retrieve_journal', 'Retrieve journal'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('retrieve_journal', 'Retrieve journal'), record_value_of_which_arg='journal_id') def retrieve_journal(journal_id): # Redirects are disabled https://github.com/DOAJ/doajPM/issues/2664 @@ -119,7 +119,7 @@ def retrieve_journal(journal_id): @blueprint.route("/bulk/applications", methods=["POST"]) @api_key_required @write_required(api=True) -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('bulk_application_create', 'Bulk application create')) +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('bulk_application_create', 'Bulk application create')) def bulk_application_create(): raise Api400Error(API_UNSUPPORTED_ERROR) @@ -127,7 +127,7 @@ def bulk_application_create(): @blueprint.route("/bulk/applications", methods=["DELETE"]) @api_key_required @write_required(api=True) -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('bulk_application_delete', 'Bulk application delete')) +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('bulk_application_delete', 'Bulk application delete')) def bulk_application_delete(): raise Api400Error(API_UNSUPPORTED_ERROR) @@ -135,14 +135,14 @@ def bulk_application_delete(): @blueprint.route("/applications", methods=["POST"]) @api_key_required @write_required(api=True) -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('create_application', 'Create application')) +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('create_application', 'Create application')) def create_application(): raise Api400Error(API_UNSUPPORTED_ERROR) @blueprint.route("/applications/", methods=["GET"]) @api_key_required -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('retrieve_application', 'Retrieve application'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('retrieve_application', 'Retrieve application'), record_value_of_which_arg='application_id') def retrieve_application(application_id): raise Api400Error(API_UNSUPPORTED_ERROR) @@ -151,7 +151,7 @@ def retrieve_application(application_id): @blueprint.route("/applications/", methods=["PUT"]) @api_key_required @write_required(api=True) -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('update_application', 'Update application'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('update_application', 'Update application'), record_value_of_which_arg='application_id') def update_application(application_id): raise Api400Error(API_UNSUPPORTED_ERROR) @@ -160,7 +160,7 @@ def update_application(application_id): @blueprint.route("/applications/", methods=["DELETE"]) @api_key_required @write_required(api=True) -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('delete_application', 'Delete application'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('delete_application', 'Delete application'), record_value_of_which_arg='application_id') def delete_application(application_id): raise Api400Error(API_UNSUPPORTED_ERROR) @@ -168,7 +168,7 @@ def delete_application(application_id): @blueprint.route("/search/applications/") @api_key_required -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('search_applications', 'Search applications'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('search_applications', 'Search applications'), record_value_of_which_arg='search_query') def search_applications(search_query): # Redirects are disabled https://github.com/DOAJ/doajPM/issues/2664 @@ -177,7 +177,7 @@ def search_applications(search_query): @blueprint.route('/search/journals/') -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('search_journals', 'Search journals'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('search_journals', 'Search journals'), record_value_of_which_arg='search_query') def search_journals(search_query): # Redirects are disabled https://github.com/DOAJ/doajPM/issues/2664 diff --git a/portality/view/api_v3.py b/portality/view/api_v3.py index d6f8e0792f..7ab4780250 100644 --- a/portality/view/api_v3.py +++ b/portality/view/api_v3.py @@ -18,8 +18,8 @@ API_VERSION_NUMBER = '3.0.1' # OA start added 2022-03-21 # Google Analytics category for API events -GA_CATEGORY = app.config.get('PLAUSIBLE_CATEGORY_API', 'API Hit') -GA_ACTIONS = app.config.get('PLAUSIBLE_ACTIONS_API', {}) +PLAUSIBLE_CATEGORY = app.config.get('PLAUSIBLE_CATEGORY_API', 'API Hit') +PLAUSIBLE_ACTIONS = app.config.get('PLAUSIBLE_ACTIONS_API', {}) @blueprint.route('/') @@ -63,7 +63,7 @@ def missing_resource(invalid_path): swag_spec=DiscoveryApi.get_application_swag()) # must be applied after @api_key_(optional|required) decorators. They don't preserve func attributes. @blueprint.route("/search/applications/") @api_key_required -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('search_applications', 'Search applications'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('search_applications', 'Search applications'), record_value_of_which_arg='search_query') def search_applications(search_query): # get the values for the 2 other bits of search info: the page number and the page size @@ -94,7 +94,7 @@ def search_applications(search_query): @swag(swag_summary='Search journals', swag_spec=DiscoveryApi.get_journal_swag()) # must be applied after @api_key_(optional|required) decorators. They don't preserve func attributes. @blueprint.route('/search/journals/') -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('search_journals', 'Search journals'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('search_journals', 'Search journals'), record_value_of_which_arg='search_query') def search_journals(search_query): # get the values for the 2 other bits of search info: the page number and the page size @@ -125,7 +125,7 @@ def search_journals(search_query): @swag(swag_summary='Search articles', swag_spec=DiscoveryApi.get_article_swag()) # must be applied after @api_key_(optional|required) decorators. They don't preserve func attributes. @blueprint.route('/search/articles/') -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('search_articles', 'Search articles'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('search_articles', 'Search articles'), record_value_of_which_arg='search_query') def search_articles(search_query): # get the values for the 2 other bits of search info: the page number and the page size @@ -162,7 +162,7 @@ def search_articles(search_query): @write_required(api=True) @swag(swag_summary='Create an application [Authenticated, not public]', swag_spec=ApplicationsCrudApi.create_swag()) # must be applied after @api_key_(optional|required) decorators. They don't preserve func attributes. -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('create_application', 'Create application')) +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('create_application', 'Create application')) def create_application(): # get the data from the request try: @@ -181,7 +181,7 @@ def create_application(): @api_key_required @swag(swag_summary='Retrieve an application [Authenticated, not public]', swag_spec=ApplicationsCrudApi.retrieve_swag()) # must be applied after @api_key_(optional|required) decorators. They don't preserve func attributes. -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('retrieve_application', 'Retrieve application'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('retrieve_application', 'Retrieve application'), record_value_of_which_arg='application_id') def retrieve_application(application_id): a = ApplicationsCrudApi.retrieve(application_id, current_user) @@ -193,7 +193,7 @@ def retrieve_application(application_id): @write_required(api=True) @swag(swag_summary='Update an application [Authenticated, not public]', swag_spec=ApplicationsCrudApi.update_swag()) # must be applied after @api_key_(optional|required) decorators. They don't preserve func attributes. -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('update_application', 'Update application'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('update_application', 'Update application'), record_value_of_which_arg='application_id') def update_application(application_id): # get the data from the request @@ -214,7 +214,7 @@ def update_application(application_id): @write_required(api=True) @swag(swag_summary='Delete an application [Authenticated, not public]', swag_spec=ApplicationsCrudApi.delete_swag()) # must be applied after @api_key_(optional|required) decorators. They don't preserve func attributes. -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('delete_application', 'Delete application'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('delete_application', 'Delete application'), record_value_of_which_arg='application_id') def delete_application(application_id): ApplicationsCrudApi.delete(application_id, current_user._get_current_object()) @@ -229,7 +229,7 @@ def delete_application(application_id): @write_required(api=True) @swag(swag_summary='Create an article [Authenticated, not public]', swag_spec=ArticlesCrudApi.create_swag()) # must be applied after @api_key_(optional|required) decorators. They don't preserve func attributes. -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('create_article', 'Create article')) +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('create_article', 'Create article')) def create_article(): # get the data from the request try: @@ -248,7 +248,7 @@ def create_article(): @api_key_optional @swag(swag_summary='Retrieve an article', swag_spec=ArticlesCrudApi.retrieve_swag()) # must be applied after @api_key_(optional|required) decorators. They don't preserve func attributes. -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('retrieve_article', 'Retrieve article'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('retrieve_article', 'Retrieve article'), record_value_of_which_arg='article_id') def retrieve_article(article_id): a = ArticlesCrudApi.retrieve(article_id, current_user) @@ -260,7 +260,7 @@ def retrieve_article(article_id): @write_required(api=True) @swag(swag_summary='Update an article [Authenticated, not public]', swag_spec=ArticlesCrudApi.update_swag()) # must be applied after @api_key_(optional|required) decorators. They don't preserve func attributes. -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('update_article', 'Update article'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('update_article', 'Update article'), record_value_of_which_arg='article_id') def update_article(article_id): # get the data from the request @@ -281,7 +281,7 @@ def update_article(article_id): @write_required(api=True) @swag(swag_summary='Delete an article [Authenticated, not public]', swag_spec=ArticlesCrudApi.delete_swag()) # must be applied after @api_key_(optional|required) decorators. They don't preserve func attributes. -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('delete_article', 'Delete article'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('delete_article', 'Delete article'), record_value_of_which_arg='article_id') def delete_article(article_id): ArticlesCrudApi.delete(article_id, current_user) @@ -295,7 +295,7 @@ def delete_article(article_id): @api_key_optional @swag(swag_summary='Retrieve a journal by ID', swag_spec=JournalsCrudApi.retrieve_swag()) # must be applied after @api_key_(optional|required) decorators. They don't preserve func attributes. -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('retrieve_journal', 'Retrieve journal'), +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('retrieve_journal', 'Retrieve journal'), record_value_of_which_arg='journal_id') def retrieve_journal(journal_id): return jsonify_data_object(JournalsCrudApi.retrieve(journal_id, current_user)) @@ -309,7 +309,7 @@ def retrieve_journal(journal_id): @write_required(api=True) @swag(swag_summary='Create applications in bulk [Authenticated, not public]', swag_spec=ApplicationsBulkApi.create_swag()) # must be applied after @api_key_(optional|required) decorators. They don't preserve func attributes. -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('bulk_application_create', 'Bulk application create')) +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('bulk_application_create', 'Bulk application create')) def bulk_application_create(): # get the data from the request try: @@ -334,7 +334,7 @@ def bulk_application_create(): @write_required(api=True) @swag(swag_summary='Delete applications in bulk [Authenticated, not public]', swag_spec=ApplicationsBulkApi.delete_swag()) # must be applied after @api_key_(optional|required) decorators. They don't preserve func attributes. -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('bulk_application_delete', 'Bulk application delete')) +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('bulk_application_delete', 'Bulk application delete')) def bulk_application_delete(): # get the data from the request try: @@ -355,7 +355,7 @@ def bulk_application_delete(): @write_required(api=True) @swag(swag_summary='Bulk article creation [Authenticated, not public]', swag_spec=ArticlesBulkApi.create_swag()) # must be applied after @api_key_(optional|required) decorators. They don't preserve func attributes. -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('bulk_article_create', 'Bulk article create')) +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('bulk_article_create', 'Bulk article create')) def bulk_article_create(): # get the data from the request try: @@ -380,7 +380,7 @@ def bulk_article_create(): @write_required(api=True) @swag(swag_summary='Bulk article delete [Authenticated, not public]', swag_spec=ArticlesBulkApi.delete_swag()) # must be applied after @api_key_(optional|required) decorators. They don't preserve func attributes. -@plausible.pa_event(GA_CATEGORY, action=GA_ACTIONS.get('bulk_article_delete', 'Bulk article delete')) +@plausible.pa_event(PLAUSIBLE_CATEGORY, action=PLAUSIBLE_ACTIONS.get('bulk_article_delete', 'Bulk article delete')) def bulk_article_delete(): # get the data from the request try: