Skip to content
Open
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
2 changes: 1 addition & 1 deletion backend/api/conferences/tests/test_query_talk.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def simple_schedule_item():
return ScheduleItemFactory(
status=ScheduleItem.STATUS.confirmed,
submission=submission,
type=ScheduleItem.TYPES.submission,
type=ScheduleItem.TYPES.talk,
conference=submission.conference,
attendees_total_capacity=None,
slot=SlotFactory(
Expand Down
7 changes: 3 additions & 4 deletions backend/api/conferences/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from cms import models as cms_models
from conferences import models as conference_models
from conferences.models import deadline as deadline_models
from schedule import models as schedule_models
from submissions import models as submission_models
from voting import models as voting_models

Expand Down Expand Up @@ -263,9 +262,9 @@ def keynote(self, info: Info, slug: str) -> Keynote | None:

@strawberry_django.field
def talks(self) -> list[ScheduleItem]:
return self.schedule_items.filter(
type=schedule_models.ScheduleItem.TYPES.submission
)
# this used to filter on the `submission` schedule item type, which was
# migrated away in schedule/migrations/0041 and no longer exists
return self.schedule_items.none()

@strawberry_django.field
def talk(self, info: Info, slug: str) -> ScheduleItem | None:
Expand Down
2 changes: 1 addition & 1 deletion backend/api/schedule/tests/test_book_spot_schedule_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def simple_schedule_item():
return ScheduleItemFactory(
status=ScheduleItem.STATUS.confirmed,
submission=submission,
type=ScheduleItem.TYPES.submission,
type=ScheduleItem.TYPES.talk,
conference=submission.conference,
attendees_total_capacity=30,
slot=SlotFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def simple_schedule_item():
return ScheduleItemFactory(
status=ScheduleItem.STATUS.confirmed,
submission=submission,
type=ScheduleItem.TYPES.submission,
type=ScheduleItem.TYPES.talk,
conference=submission.conference,
attendees_total_capacity=30,
slot=SlotFactory(
Expand Down
8 changes: 4 additions & 4 deletions backend/api/schedule/tests/test_schedule_invitation.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_fetch_an_invitation(
status=ScheduleItem.STATUS.confirmed,
speaker_invitation_notes="notes",
submission=submission,
type=ScheduleItem.TYPES.submission,
type=ScheduleItem.TYPES.talk,
conference=submission.conference,
slot=SlotFactory(
day=DayFactory(
Expand Down Expand Up @@ -66,7 +66,7 @@ def test_random_user_cannot_fetch_the_invite(
status=ScheduleItem.STATUS.confirmed,
speaker_invitation_notes="notes",
submission=submission,
type=ScheduleItem.TYPES.submission,
type=ScheduleItem.TYPES.talk,
conference=submission.conference,
slot=SlotFactory(
day=DayFactory(
Expand Down Expand Up @@ -106,7 +106,7 @@ def test_staff_can_fetch_the_invite(
status=ScheduleItem.STATUS.confirmed,
speaker_invitation_notes="notes",
submission=submission,
type=ScheduleItem.TYPES.submission,
type=ScheduleItem.TYPES.talk,
conference=submission.conference,
slot=SlotFactory(
day=DayFactory(
Expand Down Expand Up @@ -143,7 +143,7 @@ def test_requires_authentication(
status=ScheduleItem.STATUS.confirmed,
speaker_invitation_notes="notes",
submission=submission,
type=ScheduleItem.TYPES.submission,
type=ScheduleItem.TYPES.talk,
conference=submission.conference,
slot=SlotFactory(
day=DayFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test_schedule_invitation_frontend_query(
status=models.ScheduleItem.STATUS.confirmed,
submission=submission,
title="Schedule title",
type=models.ScheduleItem.TYPES.submission,
type=models.ScheduleItem.TYPES.talk,
slot=SlotFactory(
day=DayFactory(conference=conference, day=date(2026, 5, 21)),
duration=30,
Expand Down
4 changes: 2 additions & 2 deletions backend/api/schedule/tests/test_star_schedule_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_star_schedule_item(
status=ScheduleItem.STATUS.confirmed,
speaker_invitation_notes="notes",
submission=submission,
type=ScheduleItem.TYPES.submission,
type=ScheduleItem.TYPES.talk,
conference=submission.conference,
slot=SlotFactory(
day=DayFactory(
Expand Down Expand Up @@ -57,7 +57,7 @@ def test_unstar_schedule_item(
status=ScheduleItem.STATUS.confirmed,
speaker_invitation_notes="notes",
submission=submission,
type=ScheduleItem.TYPES.submission,
type=ScheduleItem.TYPES.talk,
conference=submission.conference,
slot=SlotFactory(
day=DayFactory(
Expand Down
12 changes: 6 additions & 6 deletions backend/api/schedule/tests/test_update_schedule_invitation.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_update_invitation_answer(

schedule_item = ScheduleItemFactory(
submission=submission,
type=ScheduleItem.TYPES.submission,
type=ScheduleItem.TYPES.talk,
conference=submission.conference,
slot=SlotFactory(
day=DayFactory(conference=submission.conference), hour="10:00", duration=30
Expand Down Expand Up @@ -113,7 +113,7 @@ def test_saving_the_same_answer_does_not_trigger_event(
status=ScheduleItem.STATUS.confirmed,
speaker_invitation_notes="notes",
submission=submission,
type=ScheduleItem.TYPES.submission,
type=ScheduleItem.TYPES.talk,
conference=submission.conference,
slot=SlotFactory(
day=DayFactory(conference=submission.conference), hour="10:00", duration=30
Expand Down Expand Up @@ -176,7 +176,7 @@ def test_changing_notes_triggers_a_new_event(
status=ScheduleItem.STATUS.confirmed,
speaker_invitation_notes="notes",
submission=submission,
type=ScheduleItem.TYPES.submission,
type=ScheduleItem.TYPES.talk,
conference=submission.conference,
slot=SlotFactory(
day=DayFactory(conference=submission.conference), hour="10:00", duration=30
Expand Down Expand Up @@ -236,7 +236,7 @@ def test_random_user_cannot_update_an_invitation(
status=ScheduleItem.STATUS.waiting_confirmation,
speaker_invitation_notes="",
submission=submission,
type=ScheduleItem.TYPES.submission,
type=ScheduleItem.TYPES.talk,
conference=submission.conference,
slot=SlotFactory(
day=DayFactory(conference=submission.conference), hour="10:00", duration=30
Expand Down Expand Up @@ -319,7 +319,7 @@ def test_requires_authentication(
status=ScheduleItem.STATUS.waiting_confirmation,
speaker_invitation_notes="",
submission=submission,
type=ScheduleItem.TYPES.submission,
type=ScheduleItem.TYPES.talk,
conference=submission.conference,
slot=SlotFactory(
day=DayFactory(conference=submission.conference), hour="10:00", duration=30
Expand Down Expand Up @@ -371,7 +371,7 @@ def test_staff_can_update_invitation_answer(

schedule_item = ScheduleItemFactory(
submission=submission,
type=ScheduleItem.TYPES.submission,
type=ScheduleItem.TYPES.talk,
conference=submission.conference,
slot=SlotFactory(
day=DayFactory(conference=submission.conference), hour="10:00", duration=30
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def test_accepted_submission_user_can_see_public_and_restricted_fields(
ScheduleItemFactory(
submission=submission,
conference=submission.conference,
type=ScheduleItem.TYPES.submission,
type=ScheduleItem.TYPES.talk,
)

data = _query(graphql_client, submission)
Expand Down
2 changes: 1 addition & 1 deletion backend/api/tests/schema/conference/test_talk.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_get_talk_not_found(graphql_client):
def test_get_talk_by_slug(graphql_client):
conference = ConferenceFactory()

ScheduleItemFactory(conference=conference, type=ScheduleItem.TYPES.submission)
ScheduleItemFactory(conference=conference, type=ScheduleItem.TYPES.talk)
keynote = ScheduleItemFactory(
conference=conference, type=ScheduleItem.TYPES.keynote
)
Expand Down
22 changes: 8 additions & 14 deletions backend/api/tests/schema/conference/test_talks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@


@mark.django_db
def test_get_all_talks(graphql_client):
def test_get_all_talks_is_always_empty(graphql_client):
conference = ConferenceFactory()
item = ScheduleItemFactory(
type=ScheduleItem.TYPES.submission, conference=conference
)
ScheduleItemFactory(type=ScheduleItem.TYPES.talk, conference=conference)

resp = graphql_client.query(
"""
Expand All @@ -26,20 +24,18 @@ def test_get_all_talks(graphql_client):
)

assert "errors" not in resp
assert resp["data"]["conference"]["talks"] == [{"title": item.title}]
assert resp["data"]["conference"]["talks"] == []


@mark.django_db
def test_frontend_talks_query_uses_two_queries(
def test_frontend_talks_query_only_looks_up_the_conference(
graphql_client, django_assert_num_queries
):
conference = ConferenceFactory()
item = ScheduleItemFactory(
type=ScheduleItem.TYPES.submission,
conference=conference,
)
ScheduleItemFactory(type=ScheduleItem.TYPES.talk, conference=conference)

with django_assert_num_queries(2):
# talks resolves to an empty queryset, so it never hits the database
with django_assert_num_queries(1):
resp = graphql_client.query(
"""
query AllTalks($code: String!) {
Expand All @@ -56,6 +52,4 @@ def test_frontend_talks_query_uses_two_queries(
)

assert "errors" not in resp
assert resp["data"]["conference"]["talks"] == [
{"id": str(item.id), "slug": item.slug}
]
assert resp["data"]["conference"]["talks"] == []
2 changes: 1 addition & 1 deletion backend/api/users/tests/test_stars.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_get_starred_schedule_items(
status=ScheduleItem.STATUS.confirmed,
speaker_invitation_notes="notes",
submission=submission,
type=ScheduleItem.TYPES.submission,
type=ScheduleItem.TYPES.talk,
conference=submission.conference,
slot=SlotFactory(
day=DayFactory(
Expand Down
1 change: 0 additions & 1 deletion backend/conferences/admin/conference.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ def run_video_uploaded_path_matcher(self, request, object_id, ignore_cache):
talk_days = (
conference.days.filter(
slots__items__type__in=[
ScheduleItem.TYPES.submission,
ScheduleItem.TYPES.talk,
ScheduleItem.TYPES.keynote,
ScheduleItem.TYPES.panel,
Expand Down
4 changes: 2 additions & 2 deletions backend/conferences/tests/test_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_get_paths_for_keynote():
def test_get_paths_for_event():
event = ScheduleItemFactory(
slug="event-1",
type=ScheduleItem.TYPES.submission,
type=ScheduleItem.TYPES.talk,
)

assert get_paths(event) == [
Expand Down Expand Up @@ -70,7 +70,7 @@ def test_trigger_frontend_revalidate(mocker):

object = ScheduleItemFactory(
slug="event-1",
type=ScheduleItem.TYPES.submission,
type=ScheduleItem.TYPES.talk,
)

trigger_frontend_revalidate(conference, object)
Expand Down
1 change: 0 additions & 1 deletion backend/schedule/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ def _send_invitations(
submission__isnull=False,
type__in=[
ScheduleItem.TYPES.talk,
ScheduleItem.TYPES.submission,
ScheduleItem.TYPES.training,
],
)
Expand Down
18 changes: 18 additions & 0 deletions backend/schedule/migrations/0059_alter_scheduleitem_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 5.2.8 on 2026-08-16 11:53

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('schedule', '0058_scheduleitemsentforvideoupload_emails_scheduled'),
]

operations = [
migrations.AlterField(
model_name='scheduleitem',
name='type',
field=models.CharField(choices=[('talk', 'Talk'), ('training', 'Training'), ('keynote', 'Keynote'), ('panel', 'Panel'), ('registration', 'Registration'), ('announcements', 'Announcements'), ('recruiting', 'Recruiting'), ('break', 'Break'), ('social', 'Social'), ('custom', 'Custom')], max_length=100, verbose_name='type'),
),
]
11 changes: 0 additions & 11 deletions backend/schedule/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ class ScheduleItemQuerySet(QuerySet, ConferenceQuerySetMixin):

class ScheduleItem(TimeStampedModel):
TYPES = Choices(
("submission", _("Submission")),
("talk", _("Talk")),
("training", _("Training")),
("keynote", _("Keynote")),
Expand Down Expand Up @@ -365,16 +364,6 @@ def speakers(self) -> list["User"]:
)

def clean(self):
if self.type == ScheduleItem.TYPES.submission and not self.submission:
raise exceptions.ValidationError(
{
"submission": _(
"You have to specify a submission when "
"using the type `submission`"
)
}
)

if self.type == ScheduleItem.TYPES.custom and not self.title:
raise exceptions.ValidationError(
{"title": _("You have to specify a title when using the type `custom`")}
Expand Down
2 changes: 1 addition & 1 deletion backend/schedule/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ScheduleItemFactory(DjangoModelFactory):
title = factory.Faker("text", max_nb_chars=100)
slug = factory.Faker("slug")
description = factory.Faker("text")
type = factory.fuzzy.FuzzyChoice(["submission", "custom"])
type = factory.fuzzy.FuzzyChoice(["talk", "custom"])
image = factory.django.ImageField()

@classmethod
Expand Down
14 changes: 0 additions & 14 deletions backend/schedule/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,6 @@
from schedule.models import ScheduleItem


@mark.django_db
def test_submission_is_required_if_type_is_submission():
schedule_item = ScheduleItemFactory(
type=ScheduleItem.TYPES.submission, submission=None, title=""
)

with pytest.raises(exceptions.ValidationError) as e:
schedule_item.clean()

assert "You have to specify a submission when using the type `submission`" in str(
e.value
)


@mark.django_db
def test_title_cannot_be_blank_if_type_is_custom():
schedule_item = ScheduleItemFactory(type=ScheduleItem.TYPES.custom, title="")
Expand Down
2 changes: 1 addition & 1 deletion backend/schedule/tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ def test_upload_schedule_item_video_drafts_one_email_per_speaker(sent_emails):
speaker = UserFactory(full_name="Marco Acierno", email="marco@placeholder.it")

sent_for_upload = _sent_for_upload_ready_to_notify(
schedule_item__type=ScheduleItem.TYPES.submission,
schedule_item__type=ScheduleItem.TYPES.talk,
schedule_item__submission__speaker=speaker,
)
ScheduleItemAdditionalSpeakerFactory(
Expand Down
Loading