Skip to content

Commit 2e41cf5

Browse files
committed
Filter community type for only community for now
1 parent e33f65f commit 2e41cf5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

label_studio/projects/api.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,16 +806,26 @@ def read_templates_and_groups():
806806
configs = []
807807
for config_file in pathlib.Path(annotation_templates_dir).glob('**/*.yml'):
808808
config = read_yaml(config_file)
809+
810+
if settings.VERSION_EDITION != 'Community':
811+
if config.get('group', '').lower() == 'Community Contributions':
812+
continue
813+
809814
if settings.VERSION_EDITION == 'Community':
810-
if settings.VERSION_EDITION.lower() != config.get('type', 'community'):
815+
if config.get('type', 'community').lower() != 'community':
811816
continue
817+
812818
if config.get('image', '').startswith('/static') and settings.HOSTNAME:
813819
# if hostname set manually, create full image urls
814820
config['image'] = settings.HOSTNAME + config['image']
815821
configs.append(config)
816822
template_groups_file = find_file(os.path.join('annotation_templates', 'groups.txt'))
817823
with open(template_groups_file, encoding='utf-8') as f:
818824
groups = f.read().splitlines()
825+
826+
if settings.VERSION_EDITION != 'Community':
827+
groups = [group for group in groups if group.lower() != 'Community Contributions']
828+
819829
logger.debug(f'{len(configs)} templates found.')
820830
return {'templates': configs, 'groups': groups}
821831

0 commit comments

Comments
 (0)