mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 05:42:15 +01:00
AY-5539 - fix wrong logic
This commit is contained in:
parent
c7f0e977f7
commit
4e07b756af
1 changed files with 6 additions and 7 deletions
|
|
@ -1841,7 +1841,7 @@ class PublisherController(BasePublisherController):
|
|||
allowed_creator_labels = self._get_allowed_creator_labels()
|
||||
for identifier, creator in self._create_context.creators.items():
|
||||
try:
|
||||
if (not self._label_matches_allowed(
|
||||
if (not self._is_label_allowed(
|
||||
creator.label, allowed_creator_labels)):
|
||||
self.log.debug(f"{creator.label} not allowed for context")
|
||||
continue
|
||||
|
|
@ -1888,13 +1888,12 @@ class PublisherController(BasePublisherController):
|
|||
self.log.debug(f"Only allowed `{allowed_creator_labels}` creators")
|
||||
return allowed_creator_labels
|
||||
|
||||
def _label_matches_allowed(self, label, allowed_labels):
|
||||
def _is_label_allowed(self, label, allowed_labels):
|
||||
"""Implement regex support for allowed labels."""
|
||||
if allowed_labels:
|
||||
allowed_patterns = re.compile("|".join(allowed_labels))
|
||||
if allowed_patterns.match(label):
|
||||
return True
|
||||
return False
|
||||
if not allowed_labels:
|
||||
return True
|
||||
allowed_patterns = re.compile("|".join(allowed_labels))
|
||||
return bool(allowed_patterns.match(label))
|
||||
|
||||
def _reset_instances(self):
|
||||
"""Reset create instances."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue