From 26394d9c265577ae4131f5e3132f01542d19e8ef Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Thu, 29 Feb 2024 11:32:35 +0100 Subject: [PATCH] frontend: useless CoprDirsLogic.get_or_create trusted_caller arg The trusted_caller was useful for Pagure Events daemon in the days when we did not allow anyone to create :pr: directory. Now when we do, there's no need to use trusted_caller argument anymore. --- frontend/coprs_frontend/coprs/logic/coprs_logic.py | 4 ++-- frontend/coprs_frontend/pagure_events.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/frontend/coprs_frontend/coprs/logic/coprs_logic.py b/frontend/coprs_frontend/coprs/logic/coprs_logic.py index 9f5494cf6..67e0198f0 100644 --- a/frontend/coprs_frontend/coprs/logic/coprs_logic.py +++ b/frontend/coprs_frontend/coprs/logic/coprs_logic.py @@ -664,7 +664,7 @@ def _valid_custom_dir_suffix(copr, dirname): return all([c.isnumeric() for c in parts[2]]) @classmethod - def get_or_create(cls, copr, dirname, trusted_caller=False): + def get_or_create(cls, copr, dirname): """ Create a CoprDir on-demand, e.g. before pull-request builds is submitted. We don't create the "main" CoprDirs here (those are created @@ -680,7 +680,7 @@ def get_or_create(cls, copr, dirname, trusted_caller=False): copr.name, )) - if not trusted_caller and not cls._valid_custom_dir_suffix(copr, dirname): + if not cls._valid_custom_dir_suffix(copr, dirname): raise exceptions.BadRequest( f"Please use directory format {copr.name}:custom: " f"or {copr.name}:pr: (for automatically removed directories)" diff --git a/frontend/coprs_frontend/pagure_events.py b/frontend/coprs_frontend/pagure_events.py index c90a08b27..0ca2d2c9d 100755 --- a/frontend/coprs_frontend/pagure_events.py +++ b/frontend/coprs_frontend/pagure_events.py @@ -279,8 +279,7 @@ def the_call(self, message): if event_info.object_type == 'pull-request': dirname = pkg.copr.name + ':pr:' + str(event_info.object_id) - copr_dir = CoprDirsLogic.get_or_create(pkg.copr, dirname, - trusted_caller=True) + copr_dir = CoprDirsLogic.get_or_create(pkg.copr, dirname) update_callback = 'pagure_flag_pull_request' scm_object_url = os.path.join(base_url, event_info.project_url_path, 'c', str(event_info.end_commit))