Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: LEAP-1322: Remove Stale Feature Flag - ff_back_2070_inner_id_12052022_short #6727

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion label_studio/core/feature_flags/stale_feature_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
'ff_front_dev_2431_delete_polygon_points_080622_short': True,
'ff_front_dev_2290_draft_in_annotation_history_short': True,
'ff_dev_2128_html_in_labels_150422_short': True,
'ff_back_2070_inner_id_12052022_short': True,
'ff_dev_2007_rework_choices_280322_short': True,
'ff_front_dev_1495_avatar_mess_210122_short': True,
'ff_front_1170_outliner_030222_short': True,
Expand Down
23 changes: 11 additions & 12 deletions label_studio/data_manager/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,17 @@ def get_all_columns(project, *_):
}
]

if flag_set('ff_back_2070_inner_id_12052022_short', user=project.organization.created_by):
result['columns'] += [
{
'id': 'inner_id',
'title': 'Inner ID',
'type': 'Number',
'help': 'Internal task ID starting from 1 for the current project',
'target': 'tasks',
'visibility_defaults': {'explore': False, 'labeling': False},
'project_defined': False,
}
]
result['columns'] += [
{
'id': 'inner_id',
'title': 'Inner ID',
'type': 'Number',
'help': 'Internal task ID starting from 1 for the current project',
'target': 'tasks',
'visibility_defaults': {'explore': False, 'labeling': False},
'project_defined': False,
}
]

if flag_set('fflag_fix_back_lsdv_4648_annotator_filter_29052023_short', user=project.organization.created_by):
project_members = project.all_members.values_list('id', flat=True)
Expand Down
22 changes: 10 additions & 12 deletions label_studio/tasks/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from data_import.models import FileUpload
from data_manager.managers import PreparedTaskManager, TaskManager
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.db import OperationalError, models, transaction
from django.db.models import CheckConstraint, JSONField, Q
from django.db.models.signals import post_delete, post_save, pre_delete, pre_save
Expand Down Expand Up @@ -517,17 +516,16 @@ def ensure_unique_groundtruth(self, annotation_id):
self.annotations.exclude(id=annotation_id).update(ground_truth=False)

def save(self, *args, update_fields=None, **kwargs):
if flag_set('ff_back_2070_inner_id_12052022_short', AnonymousUser):
if self.inner_id == 0:
task = Task.objects.filter(project=self.project).order_by('-inner_id').first()
max_inner_id = 1
if task:
max_inner_id = task.inner_id

# max_inner_id might be None in the old projects
self.inner_id = None if max_inner_id is None else (max_inner_id + 1)
if update_fields is not None:
update_fields = {'inner_id'}.union(update_fields)
if self.inner_id == 0:
task = Task.objects.filter(project=self.project).order_by('-inner_id').first()
max_inner_id = 1
if task:
max_inner_id = task.inner_id

# max_inner_id might be None in the old projects
self.inner_id = None if max_inner_id is None else (max_inner_id + 1)
if update_fields is not None:
update_fields = {'inner_id'}.union(update_fields)

super().save(*args, update_fields=update_fields, **kwargs)

Expand Down
Loading