Skip to content

Commit 966e1c8

Browse files
chore: remove editor_label field from ConstraintName model (ietf-tools#3783)
1 parent 994e6c3 commit 966e1c8

4 files changed

Lines changed: 56 additions & 11 deletions

File tree

ietf/name/fixtures/names.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6323,7 +6323,6 @@
63236323
{
63246324
"fields": {
63256325
"desc": "",
6326-
"editor_label": "<i class=\"bi bi-person\"></i>{count}",
63276326
"is_group_conflict": false,
63286327
"name": "Person must be present",
63296328
"order": 4,
@@ -6336,7 +6335,6 @@
63366335
{
63376336
"fields": {
63386337
"desc": "Indicates other WGs the chairs also lead or will be active participants in",
6339-
"editor_label": "<i class=\"bi bi-person-plus\"></i>",
63406338
"is_group_conflict": true,
63416339
"name": "Chair conflict",
63426340
"order": 8,
@@ -6349,7 +6347,6 @@
63496347
{
63506348
"fields": {
63516349
"desc": "",
6352-
"editor_label": "<span class=\"encircled\">2</span>",
63536350
"is_group_conflict": true,
63546351
"name": "Conflicts with (secondary)",
63556352
"order": 2,
@@ -6362,7 +6359,6 @@
63626359
{
63636360
"fields": {
63646361
"desc": "",
6365-
"editor_label": "<span class=\"encircled\">3</span>",
63666362
"is_group_conflict": true,
63676363
"name": "Conflicts with (tertiary)",
63686364
"order": 3,
@@ -6375,7 +6371,6 @@
63756371
{
63766372
"fields": {
63776373
"desc": "",
6378-
"editor_label": "<span class=\"encircled\">1</span>",
63796374
"is_group_conflict": true,
63806375
"name": "Conflicts with",
63816376
"order": 1,
@@ -6388,7 +6383,6 @@
63886383
{
63896384
"fields": {
63906385
"desc": "Indicates WGs with which key participants (presenter, secretary, etc.) may overlap",
6391-
"editor_label": "<i class=\"bi bi-key\"></i>",
63926386
"is_group_conflict": true,
63936387
"name": "Key participant conflict",
63946388
"order": 10,
@@ -6401,7 +6395,6 @@
64016395
{
64026396
"fields": {
64036397
"desc": "Indicates WGs with a related technology or a closely related charter",
6404-
"editor_label": "<i class=\"bi bi-link\"></i>",
64056398
"is_group_conflict": true,
64066399
"name": "Technology overlap",
64076400
"order": 9,
@@ -6414,7 +6407,6 @@
64146407
{
64156408
"fields": {
64166409
"desc": "",
6417-
"editor_label": "&Delta;",
64186410
"is_group_conflict": false,
64196411
"name": "Preference for time between sessions",
64206412
"order": 6,
@@ -6427,7 +6419,6 @@
64276419
{
64286420
"fields": {
64296421
"desc": "",
6430-
"editor_label": "<i class=\"bi bi-calendar\"></i>",
64316422
"is_group_conflict": false,
64326423
"name": "Can't meet within timerange",
64336424
"order": 5,
@@ -6440,7 +6431,6 @@
64406431
{
64416432
"fields": {
64426433
"desc": "",
6443-
"editor_label": "<i class=\"bi bi-skip-end\"></i>",
64446434
"is_group_conflict": false,
64456435
"name": "Request for adjacent scheduling with another WG",
64466436
"order": 7,
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Generated by Django 2.2.27 on 2022-03-11 07:55
2+
3+
from django.db import migrations
4+
5+
6+
def forward(apps, schema_editor):
7+
pass # nothing to do, row will be dropped
8+
9+
10+
def reverse(apps, schema_editor):
11+
# Restore data from when this migration was written. Dumped with:
12+
# >>> from pprint import pp
13+
# >>> from ietf.name.models import ConstraintName
14+
# >>> pp(list(ConstraintName.objects.values_list('slug', 'editor_label')))
15+
ConstraintName = apps.get_model('name', 'ConstraintName')
16+
for slug, editor_label in [
17+
('conflict', '<span class="encircled">1</span>'),
18+
('conflic2', '<span class="encircled">2</span>'),
19+
('conflic3', '<span class="encircled">3</span>'),
20+
('bethere', '<i class="fa fa-user-o"></i>{count}'),
21+
('timerange', '<i class="fa fa-calendar-o"></i>'),
22+
('time_relation', '&Delta;'),
23+
('wg_adjacent', '<i class="fa fa-step-forward"></i>'),
24+
('chair_conflict', '<i class="fa fa-gavel"></i>'),
25+
('tech_overlap', '<i class="fa fa-rocket"></i>'),
26+
('key_participant', '<i class="fa fa-key"></i>'),
27+
]:
28+
ConstraintName.objects.filter(slug=slug).update(editor_label=editor_label)
29+
30+
31+
class Migration(migrations.Migration):
32+
33+
dependencies = [
34+
('name', '0038_disuse_offagenda_and_reserved'),
35+
]
36+
37+
operations = [
38+
migrations.RunPython(forward, reverse)
39+
]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Generated by Django 2.2.27 on 2022-03-11 10:05
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('name', '0039_depopulate_constraintname_editor_label'),
10+
]
11+
12+
operations = [
13+
migrations.RemoveField(
14+
model_name='constraintname',
15+
name='editor_label',
16+
),
17+
]

ietf/name/models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ class TimeSlotTypeName(NameModel):
8585
class ConstraintName(NameModel):
8686
"""conflict, conflic2, conflic3, bethere, timerange, time_relation, wg_adjacent"""
8787
penalty = models.IntegerField(default=0, help_text="The penalty for violating this kind of constraint; for instance 10 (small penalty) or 10000 (large penalty)")
88-
editor_label = models.CharField(max_length=64, blank=True, help_text="Very short label for producing warnings inline in the sessions in the schedule editor.")
8988
is_group_conflict = models.BooleanField(default=False, help_text="Does this constraint capture a conflict between groups?")
9089
class TimerangeName(NameModel):
9190
"""(monday|tuesday|wednesday|thursday|friday)-(morning|afternoon-early|afternoon-late)"""

0 commit comments

Comments
 (0)