Skip to content

Commit cabf95d

Browse files
committed
Fixed an issue where a session was saved without a type_id, found by the Django 2.2 checks. The code set the value just after the first save, and then did a second save, but this is 1) more costly, and 2) keeps an invalid session object in the database for a short time.
- Legacy-Id: 18084
1 parent 472584b commit cabf95d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

ietf/meeting/forms.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,11 @@ def clean_requested_duration(self):
250250
def save(self, *args, **kwargs):
251251
"""NOTE: as the baseform of an inlineformset self.save(commit=True)
252252
never gets called"""
253-
session = super(InterimSessionModelForm, self).save(commit=kwargs.get('commit', True))
253+
session = super(InterimSessionModelForm, self).save(commit=False)
254254
session.group = self.group
255255
session.type_id = 'regular'
256+
if kwargs.get('commit', True) is True:
257+
super(InterimSessionModelForm, self).save(commit=True)
256258
return session
257259

258260
def save_agenda(self):

0 commit comments

Comments
 (0)