Skip to content

Introduce check if use_bugzilla_id is enabled #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions bugzilla2gitlab/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,19 @@ def save(self):
return

self.id = response["iid"]

"""
Check if created issue ID matches requested ID if
option to keep numbers is enabled. Otherwise things
can become quite messy
"""
if CONF.use_bugzilla_id is True:
if int(self.id) != int(self.bug_id):
raise Exception(
"Issue id [{}]!=[{}]: missing owner permission for gitlab user id {}".format(
self.id, self.bug_id, self.sudo
)
)
print("Created issue with id: {}".format(self.id))

def close(self):
Expand Down