Skip to content

Commit

Permalink
frontend: useless CoprDirsLogic.get_or_create trusted_caller arg
Browse files Browse the repository at this point in the history
The trusted_caller was useful for Pagure Events daemon in the days when
we did not allow anyone to create :pr:<ID> directory.  Now when we do,
there's no need to use trusted_caller argument anymore.
  • Loading branch information
praiskup committed Feb 29, 2024
1 parent ed57226 commit 42f90c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions frontend/coprs_frontend/coprs/logic/coprs_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:<SUFFIX_OF_CHOICE> "
f"or {copr.name}:pr:<ID> (for automatically removed directories)"
Expand Down
3 changes: 1 addition & 2 deletions frontend/coprs_frontend/pagure_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 42f90c1

Please sign in to comment.