Skip to content
Open
1 change: 1 addition & 0 deletions label_studio/core/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,7 @@
INTERACTIVE_DATA_SERIALIZER = 'data_export.serializers.BaseExportDataSerializerForInteractive'
PROJECT_IMPORT_PERMISSION = 'projects.permissions.ProjectImportPermission'
DELETE_TASKS_ANNOTATIONS_POSTPROCESS = None
PROJECT_SAVE_DIMENSIONS_POSTPROCESS = None
FEATURE_FLAGS_GET_USER_REPR = 'core.feature_flags.utils.get_user_repr'
FEATURE_FLAGS_GET_USER_REPR_FROM_ORGANIZATION = 'core.feature_flags.utils.get_user_repr_from_organization'

Expand Down
11 changes: 10 additions & 1 deletion label_studio/projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ def save(self, *args, update_fields=None, recalc=True, **kwargs):
if label_config_has_changed or project_with_config_just_created:
self.data_types = extract_data_types(self.label_config)
self.parsed_label_config = parse_config(self.label_config)
self.label_config_hash = hash(str(self.parsed_label_config))
self.label_config_hash = hash(str(self.label_config))
if update_fields is not None:
update_fields = {'data_types', 'parsed_label_config', 'label_config_hash'}.union(update_fields)

Expand Down Expand Up @@ -895,6 +895,15 @@ def save(self, *args, update_fields=None, recalc=True, **kwargs):
elif self.num_annotations == 0 and self.num_drafts == 0:
summary.reset(tasks_data_based=False)

# Call dimensions postprocess if configured (LSE feature)
dimensions_postprocess = load_func(settings.PROJECT_SAVE_DIMENSIONS_POSTPROCESS)
if dimensions_postprocess is not None:
dimensions_postprocess(
project=self,
created=not exists,
label_config_has_changed=label_config_has_changed,
)

# ============================================================================
# FSM Integration
# ============================================================================
Expand Down
Loading
Loading