mirror of
https://github.com/varunsridharan/github-gitea-mirror.git
synced 2024-09-11 17:56:39 +03:00
Ensure that an iterable blacklist exists
This commit is contained in:
parent
d3c463782d
commit
9f315504c0
@ -205,7 +205,11 @@ def giteaGetAllUsersOrgs(type):
|
|||||||
|
|
||||||
|
|
||||||
def isBlacklistedRepository(full_name):
|
def isBlacklistedRepository(full_name):
|
||||||
for pattern in config['blacklist']:
|
blacklist = config.get('blacklist', [])
|
||||||
|
if isinstance(blacklist, str):
|
||||||
|
blacklist = [blacklist]
|
||||||
|
|
||||||
|
for pattern in blacklist:
|
||||||
if fnmatch.fnmatch(full_name, pattern):
|
if fnmatch.fnmatch(full_name, pattern):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
Loading…
Reference in New Issue
Block a user