Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_nicks(self, nicknames):
def handler(user, data):
data[user["name"]] = user["nick"]
users = set(nicknames.values())
data = {}
if users:
BugzillaUser(
user_names=list(users),
include_fields=["name", "nick"],
user_handler=handler,
user_data=data,
).wait()
for bugid, name in nicknames.items():
nicknames[bugid] = (name, data[name])
return nicknames
no_nick[winner] = []
no_nick[winner].append(bugid)
else:
winner = {
"mail": info["creator"]["email"],
"nickname": info["creator"]["nick"],
}
self.add_auto_ni(bugid, winner)
if no_nick:
def user_handler(user, data):
data[user["name"]] = user["nick"]
data = {}
BugzillaUser(
user_names=list(no_nick.keys()),
include_fields=["name", "nick"],
user_handler=user_handler,
user_data=data,
).wait()
for bzmail, bugids in no_nick.items():
nick = data[bzmail]
for bugid in bugids:
self.add_auto_ni(bugid, {"mail": bzmail, "nickname": nick})
def get_nick(self, bzmail, prod_comp, cal):
if bzmail not in self.nicks:
def handler(user):
self.nicks[bzmail] = user["nick"]
BugzillaUser(user_names=[bzmail], user_handler=handler).wait()
if bzmail not in self.nicks:
self.add_erroneous_bzmail(bzmail, prod_comp, cal)
return None
return self.nicks[bzmail]
def get_user_info(self, bzdata):
"""Get the user info from Bugzilla to have his real name.
"""
def handler(user, data):
data[user["name"]] = user["real_name"]
users = set()
for info in bzdata.values():
users |= info["creators"]
users |= set(info["commenters"].keys())
data = {}
if users:
BugzillaUser(
user_names=list(users), user_handler=handler, user_data=data
).wait()
return data