Skip to content

Commit

Permalink
Fix get_fork for Pagure (#800)
Browse files Browse the repository at this point in the history
Fix get_fork for Pagure

When getting the fork from existing forks, check for equality of the usernames and not only substring check with 'in' operator. This prevents getting a fork of 'packit-stg' for user 'packit'.
Fixes packit/packit-service#2178
RELEASE NOTES BEGIN
We have fixed a bug in get_fork method for Pagure about checking the usernames for a match when going through existing forks.
RELEASE NOTES END

Reviewed-by: Matej Focko
  • Loading branch information
2 parents cfd9f97 + 61d5af3 commit 8ebc261
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ogr/services/pagure/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def get_fork(self, create: bool = True) -> Optional["PagureProject"]:

for fork in self.get_forks():
fork_info = fork.get_project_info()
if self._user in fork_info["user"]["name"]:
if self._user == fork_info["user"]["name"]:
return fork

if not self.is_forked():
Expand Down

0 comments on commit 8ebc261

Please sign in to comment.