Skip to content

Commit

Permalink
Rename KiD to NEXUS (#3629)
Browse files Browse the repository at this point in the history
* Rename KiD to NEXUS

* Convert event types

* Update survey types migration
  • Loading branch information
Bestem0r authored Sep 8, 2024
1 parent 5e547de commit 805fcfc
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lego/apps/events/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ALTERNATIVE_PRESENTATION = "alternative_presentation"
COURSE = "course"
BREAKFAST_TALK = "breakfast_talk"
KID_EVENT = "kid_event"
NEXUS_EVENT = "nexus_event"
PARTY = "party"
SOCIAL = "social"
OTHER = "other"
Expand All @@ -17,7 +17,7 @@
(ALTERNATIVE_PRESENTATION, ALTERNATIVE_PRESENTATION),
(COURSE, COURSE),
(BREAKFAST_TALK, BREAKFAST_TALK),
(KID_EVENT, KID_EVENT),
(NEXUS_EVENT, NEXUS_EVENT),
(PARTY, PARTY),
(SOCIAL, SOCIAL),
(OTHER, OTHER),
Expand All @@ -30,7 +30,7 @@
ALTERNATIVE_PRESENTATION: "Alternativ presentasjon",
COURSE: "Kurs",
BREAKFAST_TALK: "Frokostforedrag",
KID_EVENT: "KID-arrangement",
NEXUS_EVENT: "NEXUS-arrangement",
PARTY: "Fest",
SOCIAL: "Sosialt",
OTHER: "Annet",
Expand Down
38 changes: 38 additions & 0 deletions lego/apps/events/migrations/0041_alter_event_event_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Generated by Django 4.0.10 on 2024-09-03 16:49

from django.db import migrations, models


def migrate_kid_to_nexus(apps, _):
event = apps.get_model("events", "Event")
event.objects.filter(event_type="kid_event").update(event_type="nexus_event")


class Migration(migrations.Migration):

dependencies = [
("events", "0040_alter_registration_presence"),
]

operations = [
migrations.AlterField(
model_name="event",
name="event_type",
field=models.CharField(
choices=[
("company_presentation", "company_presentation"),
("lunch_presentation", "lunch_presentation"),
("alternative_presentation", "alternative_presentation"),
("course", "course"),
("breakfast_talk", "breakfast_talk"),
("nexus_event", "nexus_event"),
("party", "party"),
("social", "social"),
("other", "other"),
("event", "event"),
],
max_length=50,
),
),
migrations.RunPython(migrate_kid_to_nexus),
]
2 changes: 1 addition & 1 deletion lego/apps/events/tests/test_events_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
"title": "Event7",
"description": "Ingress7",
"text": "Ingress7",
"eventType": "kid_event",
"eventType": "nexus_event",
"eventStatusType": "OPEN",
"location": "F252",
"startTime": "2015-09-01T13:20:30Z",
Expand Down
6 changes: 3 additions & 3 deletions lego/apps/surveys/fixtures/survey_template_fixtures.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
- model: surveys.Survey
pk: 4
fields:
title: 'Template: kid_event'
title: 'Template: nexus_event'
event: 4
template_type: 'kid_event'
template_type: 'nexus_event'

- model: surveys.Survey
pk: 5
Expand Down Expand Up @@ -130,7 +130,7 @@
option_text: 'Nei'
question: 3

# kid_event
# nexus_event

- model: surveys.Question
pk: 4
Expand Down
41 changes: 41 additions & 0 deletions lego/apps/surveys/migrations/0012_alter_survey_template_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Generated by Django 4.0.10 on 2024-09-03 16:49

from django.db import migrations, models


def migrate_kid_to_nexus(apps, _):
event = apps.get_model("surveys", "Survey")
event.objects.filter(template_type="kid_event").update(template_type="nexus_event")


class Migration(migrations.Migration):

dependencies = [
("surveys", "0011_alter_survey_template_type"),
]

operations = [
migrations.AlterField(
model_name="survey",
name="template_type",
field=models.CharField(
blank=True,
choices=[
("company_presentation", "company_presentation"),
("lunch_presentation", "lunch_presentation"),
("alternative_presentation", "alternative_presentation"),
("course", "course"),
("breakfast_talk", "breakfast_talk"),
("nexus_event", "nexus_event"),
("party", "party"),
("social", "social"),
("other", "other"),
("event", "event"),
],
max_length=30,
null=True,
unique=True,
),
),
migrations.RunPython(migrate_kid_to_nexus),
]
2 changes: 1 addition & 1 deletion lego/apps/users/fixtures/test_abakus_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"permissions": [
"/sudo/admin/events/list/",
"/sudo/admin/events/view/",
"/sudo/admin/events/create/kid_event/",
"/sudo/admin/events/create/nexus_event/",
]
},
{},
Expand Down
2 changes: 1 addition & 1 deletion lego/apps/users/fixtures/test_abakus_groups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
logo: null
type: annen
text: ''
permissions: '["/sudo/admin/events/list/", "/sudo/admin/events/view/", "/sudo/admin/events/create/kid_event/"]'
permissions: '["/sudo/admin/events/list/", "/sudo/admin/events/view/", "/sudo/admin/events/create/nexus_event/"]'
show_badge: true
active: true
lft: 1
Expand Down

0 comments on commit 805fcfc

Please sign in to comment.