Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/backend-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

services:
postgres:
image: postgres:14.5
image: postgres:18.6
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/claude.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

services:
postgres:
image: postgres:14.5
image: postgres:18.6
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
Expand Down
1 change: 1 addition & 0 deletions backend/pycon/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"django.contrib.postgres",
"api.apps.ApiConfig",
"timezone_field",
"strawberry.django",
Expand Down
12 changes: 6 additions & 6 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ known-first-party = [
[project]
requires-python = ">=3.14.7"
dependencies = [
"django==5.2.18",
"django==6.1.3",
"django-environ==0.14.0",
"django-model-utils==5.0.0",
"django-timezone-field==7.0",
"django-timezone-field==7.2.2",
"certifi==2026.10.23",
"chardet==5.2.0",
"idna==3.15",
Expand All @@ -61,9 +61,9 @@ dependencies = [
"boto3==1.43.34",
"pycountry<20.0,>=19.8",
"countries<1.0.0,>=0.2.0",
"django-ses==4.1.1",
"django-ses==4.9.0",
"hashids<2.0.0,>=1.2.0",
"django-autocomplete-light==3.9.4",
"django-autocomplete-light==4.0.3",
"django-queryinspect<2.0.0,>=1.1.0",
"lxml==6.1.0",
"unidecode<2.0.0,>=1.1.1",
Expand All @@ -82,8 +82,8 @@ dependencies = [
"stripe==10.5.0",
"djangorestframework==3.18.3",
"l18n<2022.0,>=2021.3",
"wagtail==7.3.4",
"wagtail-localize==1.13",
"wagtail==8.1",
"wagtail-localize==1.14.5",
"celery==5.6.3",
"wagtail-headless-preview==0.8.0",
"Jinja2>=3.1.6",
Expand Down
2 changes: 1 addition & 1 deletion backend/schedule/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def mark_speakers_to_receive_vouchers(modeladmin, request, queryset):
.distinct()
)

conference = queryset.only("conference_id").first().conference
conference = queryset.first().conference

existing_vouchers: dict[int, ConferenceVoucher.VoucherType] = {
user_id: voucher_type
Expand Down
11 changes: 8 additions & 3 deletions backend/schedule/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
pytestmark = pytest.mark.django_db


def test_mark_speakers_to_receive_vouchers(rf, mocker):
def test_mark_speakers_to_receive_vouchers(rf, mocker, admin_superuser):
mocker.patch(
"conferences.models.conference_voucher.get_random_string",
side_effect=[
Expand All @@ -54,11 +54,16 @@ def test_mark_speakers_to_receive_vouchers(rf, mocker):
conference=conference,
submission=None,
)
request = rf.get("/")
request.user = admin_superuser
changelist = ScheduleItemAdmin(ScheduleItem, AdminSite()).get_changelist_instance(
request
)

mark_speakers_to_receive_vouchers(
None,
request=rf.get("/"),
queryset=ScheduleItem.objects.filter(conference=conference),
request=request,
queryset=changelist.get_queryset(request).filter(conference=conference),
)

assert ConferenceVoucher.objects.count() == 2
Expand Down
88 changes: 58 additions & 30 deletions backend/uv.lock

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions backend/voting/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ class SubmissionFilter(AutocompleteFilter):
field_name = "submission"
autocomplete_url = "submission-autocomplete"

def get_queryset_for_field(self, model, name):
# dal_admin_filters calls the FK descriptor's get_queryset() without the
# `instance` argument Django requires.
return model._meta.get_field(name).related_model._base_manager.all()


class ConferenceFilter(AutocompleteFilter):
title = "Conference"
Expand Down
17 changes: 15 additions & 2 deletions backend/voting/tests/test_admin.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
import pytest
from django.contrib import admin

from i18n.strings import LazyI18nString
from voting.admin import RankSubmissionResource
from voting.models import RankSubmission
from voting.admin import RankSubmissionResource, VoteAdmin
from voting.models import RankSubmission, Vote
from voting.tests.factories.ranking import RankSubmissionFactory
from voting.tests.factories.vote import VoteFactory

pytestmark = pytest.mark.django_db


def test_vote_changelist_filters_by_submission(rf, admin_superuser):
vote = VoteFactory()
VoteFactory()
request = rf.get("/", {"submission__id__exact": vote.submission_id})
request.user = admin_superuser

changelist = VoteAdmin(Vote, admin.site).get_changelist_instance(request)

assert list(changelist.queryset) == [vote]


def test_rank_submission_export_includes_submission_title():
RankSubmissionFactory(submission__title=LazyI18nString({"en": "My talk"}))

Expand Down
Loading