Skip to content

Commit c6f5430

Browse files
Quick fix
Signed-off-by: Lukasz Gryglicki <[email protected]>
1 parent e4a0d08 commit c6f5430

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

cla-backend/cla/models/github_models.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ def parse_config_patterns(self, config):
10011001
else:
10021002
return [config]
10031003

1004-
def safe_getattr(obj, attr, default='(null)'):
1004+
def safe_getattr(self, obj, attr, default='(null)'):
10051005
"""Returns obj.attr or default if attr is missing or None."""
10061006
val = getattr(obj, attr, default)
10071007
if val is None:
@@ -1077,10 +1077,10 @@ def skip_whitelisted_bots(self, org_model, org_repo, actors_missing_cla) -> Tupl
10771077
return actors_missing_cla, []
10781078

10791079
actor_debug_data = [
1080-
f"id='{safe_getattr(a, 'author_id')}',"
1081-
f"login='{safe_getattr(a, 'author_login')}',"
1082-
f"name='{safe_getattr(a, 'author_name')}',"
1083-
f"email='{safe_getattr(a, 'author_email')}'"
1080+
f"id='{self.safe_getattr(a, 'author_id')}',"
1081+
f"login='{self.safe_getattr(a, 'author_login')}',"
1082+
f"name='{self.safe_getattr(a, 'author_name')}',"
1083+
f"email='{self.safe_getattr(a, 'author_email')}'"
10841084
for a in actors_missing_cla
10851085
]
10861086
config = self.parse_config_patterns(config)
@@ -1092,10 +1092,10 @@ def skip_whitelisted_bots(self, org_model, org_repo, actors_missing_cla) -> Tupl
10921092
continue
10931093
try:
10941094
actor_data = "id='{}',login='{}',name='{}',email='{}'".format(
1095-
safe_getattr(actor, "author_id"),
1096-
safe_getattr(actor, "author_login"),
1097-
safe_getattr(actor, "author_name"),
1098-
safe_getattr(actor, "author_email"),
1095+
self.safe_getattr(actor, "author_id"),
1096+
self.safe_getattr(actor, "author_login"),
1097+
self.safe_getattr(actor, "author_name"),
1098+
self.safe_getattr(actor, "author_email"),
10991099
)
11001100
cla.log.debug("Checking actor: %s for skip_cla config: %s", actor_data, config)
11011101
if self.is_actor_skipped(actor, config):
@@ -1119,10 +1119,10 @@ def skip_whitelisted_bots(self, org_model, org_repo, actors_missing_cla) -> Tupl
11191119
cla.log.warning(
11201120
"Error checking skip_cla for actor '%s' (id='%s', login='%s', name='%s', email='%s'): %s",
11211121
actor,
1122-
safe_getattr(actor, "author_id"),
1123-
safe_getattr(actor, "author_login"),
1124-
safe_getattr(actor, "author_name"),
1125-
safe_getattr(actor, "author_email"),
1122+
self.safe_getattr(actor, "author_id"),
1123+
self.safe_getattr(actor, "author_login"),
1124+
self.safe_getattr(actor, "author_name"),
1125+
self.safe_getattr(actor, "author_email"),
11261126
e,
11271127
)
11281128
out_actors_missing_cla.append(actor)

0 commit comments

Comments
 (0)