Skip to content

Commit

Permalink
chore: remove editor_label field from ConstraintName model (#3783)
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-richards committed Apr 14, 2022
1 parent 994e6c3 commit 966e1c8
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 11 deletions.
10 changes: 0 additions & 10 deletions ietf/name/fixtures/names.json
Original file line number Diff line number Diff line change
Expand Up @@ -6323,7 +6323,6 @@
{
"fields": {
"desc": "",
"editor_label": "<i class=\"bi bi-person\"></i>{count}",
"is_group_conflict": false,
"name": "Person must be present",
"order": 4,
Expand All @@ -6336,7 +6335,6 @@
{
"fields": {
"desc": "Indicates other WGs the chairs also lead or will be active participants in",
"editor_label": "<i class=\"bi bi-person-plus\"></i>",
"is_group_conflict": true,
"name": "Chair conflict",
"order": 8,
Expand All @@ -6349,7 +6347,6 @@
{
"fields": {
"desc": "",
"editor_label": "<span class=\"encircled\">2</span>",
"is_group_conflict": true,
"name": "Conflicts with (secondary)",
"order": 2,
Expand All @@ -6362,7 +6359,6 @@
{
"fields": {
"desc": "",
"editor_label": "<span class=\"encircled\">3</span>",
"is_group_conflict": true,
"name": "Conflicts with (tertiary)",
"order": 3,
Expand All @@ -6375,7 +6371,6 @@
{
"fields": {
"desc": "",
"editor_label": "<span class=\"encircled\">1</span>",
"is_group_conflict": true,
"name": "Conflicts with",
"order": 1,
Expand All @@ -6388,7 +6383,6 @@
{
"fields": {
"desc": "Indicates WGs with which key participants (presenter, secretary, etc.) may overlap",
"editor_label": "<i class=\"bi bi-key\"></i>",
"is_group_conflict": true,
"name": "Key participant conflict",
"order": 10,
Expand All @@ -6401,7 +6395,6 @@
{
"fields": {
"desc": "Indicates WGs with a related technology or a closely related charter",
"editor_label": "<i class=\"bi bi-link\"></i>",
"is_group_conflict": true,
"name": "Technology overlap",
"order": 9,
Expand All @@ -6414,7 +6407,6 @@
{
"fields": {
"desc": "",
"editor_label": "&Delta;",
"is_group_conflict": false,
"name": "Preference for time between sessions",
"order": 6,
Expand All @@ -6427,7 +6419,6 @@
{
"fields": {
"desc": "",
"editor_label": "<i class=\"bi bi-calendar\"></i>",
"is_group_conflict": false,
"name": "Can't meet within timerange",
"order": 5,
Expand All @@ -6440,7 +6431,6 @@
{
"fields": {
"desc": "",
"editor_label": "<i class=\"bi bi-skip-end\"></i>",
"is_group_conflict": false,
"name": "Request for adjacent scheduling with another WG",
"order": 7,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Generated by Django 2.2.27 on 2022-03-11 07:55

from django.db import migrations


def forward(apps, schema_editor):
pass # nothing to do, row will be dropped


def reverse(apps, schema_editor):
# Restore data from when this migration was written. Dumped with:
# >>> from pprint import pp
# >>> from ietf.name.models import ConstraintName
# >>> pp(list(ConstraintName.objects.values_list('slug', 'editor_label')))
ConstraintName = apps.get_model('name', 'ConstraintName')
for slug, editor_label in [
('conflict', '<span class="encircled">1</span>'),
('conflic2', '<span class="encircled">2</span>'),
('conflic3', '<span class="encircled">3</span>'),
('bethere', '<i class="fa fa-user-o"></i>{count}'),
('timerange', '<i class="fa fa-calendar-o"></i>'),
('time_relation', '&Delta;'),
('wg_adjacent', '<i class="fa fa-step-forward"></i>'),
('chair_conflict', '<i class="fa fa-gavel"></i>'),
('tech_overlap', '<i class="fa fa-rocket"></i>'),
('key_participant', '<i class="fa fa-key"></i>'),
]:
ConstraintName.objects.filter(slug=slug).update(editor_label=editor_label)


class Migration(migrations.Migration):

dependencies = [
('name', '0038_disuse_offagenda_and_reserved'),
]

operations = [
migrations.RunPython(forward, reverse)
]
17 changes: 17 additions & 0 deletions ietf/name/migrations/0040_remove_constraintname_editor_label.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 2.2.27 on 2022-03-11 10:05

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('name', '0039_depopulate_constraintname_editor_label'),
]

operations = [
migrations.RemoveField(
model_name='constraintname',
name='editor_label',
),
]
1 change: 0 additions & 1 deletion ietf/name/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ class TimeSlotTypeName(NameModel):
class ConstraintName(NameModel):
"""conflict, conflic2, conflic3, bethere, timerange, time_relation, wg_adjacent"""
penalty = models.IntegerField(default=0, help_text="The penalty for violating this kind of constraint; for instance 10 (small penalty) or 10000 (large penalty)")
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.")
is_group_conflict = models.BooleanField(default=False, help_text="Does this constraint capture a conflict between groups?")
class TimerangeName(NameModel):
"""(monday|tuesday|wednesday|thursday|friday)-(morning|afternoon-early|afternoon-late)"""
Expand Down

0 comments on commit 966e1c8

Please sign in to comment.