From: Magnus Hagander Date: Tue, 7 Oct 2025 12:03:03 +0000 (+0200) Subject: Fix editing of submitted sessions on cfp X-Git-Url: http://git.postgresql.org/gitweb/static/session/%7B%7Bsession.id%7D%7D-%7B%7Bsession.title%7Cslugify%7D%7D?a=commitdiff_plain;h=5e623e1fe6709f0615f57bbdf8eb61e13c775298;p=pgeu-system.git Fix editing of submitted sessions on cfp Commit 1a0b919c added verification that one didn't submit the same session twice, but as a side-effcect that also prevented editing an existing session. Reported by Andrey Borodin --- diff --git a/postgresqleu/confreg/views.py b/postgresqleu/confreg/views.py index 6e6f1673..fc510c9a 100644 --- a/postgresqleu/confreg/views.py +++ b/postgresqleu/confreg/views.py @@ -1976,7 +1976,10 @@ def callforpapers_edit(request, confname, sessionid): form = CallForPapersForm(speaker, data=request.POST, instance=session, initial=initial) if form.is_valid(): with transaction.atomic(): - if ConferenceSession.objects.filter(conference=conference, speaker=speaker, title=form.cleaned_data['title']).exists(): + q = ConferenceSession.objects.filter(conference=conference, speaker=speaker, title=form.cleaned_data['title']) + if session.pk: + q = q.exclude(pk=session.pk) + if q.exists(): form.add_error('title', "You have already submitted a session with title '{}' to this conference.".format(session.title)) else: form.save()