Skip to content

Commit 25fc2ba

Browse files
committed
push rules fix
1 parent 01dc5fc commit 25fc2ba

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

projects.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,13 +1141,15 @@ def create_var(var):
11411141

11421142
# Get existing rules, None if not exist
11431143
pr = project.pushrules.get()
1144-
old_pr_dict = pr.asdict()
11451144
if pr is None:
1145+
old_pr_dict = {}
11461146
# At least one option is required to create, use commit_committer_check
11471147
project.pushrules.create({'commit_committer_check': project_dict["push_rules"]["commit_committer_check"]})
11481148
pr = project.pushrules.get()
1149+
else:
1150+
old_pr_dict = pr.asdict()
11491151

1150-
# Set othe params
1152+
# Set other params
11511153
pr.commit_committer_check = project_dict["push_rules"]["commit_committer_check"]
11521154
if "commit_committer_name_check" in project_dict["push_rules"]:
11531155
pr.commit_committer_name_check = project_dict["push_rules"]["commit_committer_name_check"]

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
python-gitlab==4.1.1
1+
python-gitlab==4.4.0
22
PyYAML==6.0
33
psycopg2-binary==2.9.6
44
#jira==2.0.0 # for jira and may be outdated

0 commit comments

Comments
 (0)