Fixed map to list

This commit is contained in:
2020-09-29 01:14:11 +02:00
parent ce61e2c258
commit e62ff8b5b7
+9 -9
View File
@@ -1716,21 +1716,21 @@ def edit_event(request):
] ]
salle_dispo = salle_dispo.filter(Salles.place_type == 'Stand') salle_dispo = salle_dispo.filter(Salles.place_type == 'Stand')
elif intervention == "Atelier": elif intervention == "Atelier":
form.duration.choices = map(lambda d: (d, u'Atelier (%dh%.2d)' % (d / 60, d % 60)), form.duration.choices = list(map(lambda d: (d, u'Atelier (%dh%.2d)' % (d / 60, d % 60)),
[60, 90, 120, 150, 180, 210, 240]) [60, 90, 120, 150, 180, 210, 240]))
if not duration in map(lambda d, y: d, form.duration.choices): if not duration in map(lambda d: d[0], form.duration.choices):
form.duration.choices.append((duration, u'Atelier (%dh%.2d)' % (duration / 60, duration % 60))) form.duration.choices.append((duration, u'Atelier (%dh%.2d)' % (duration / 60, duration % 60)))
salle_dispo = salle_dispo.filter(Salles.place_type.in_(['Atelier', 'MAO'])) salle_dispo = salle_dispo.filter(Salles.place_type.in_(['Atelier', 'MAO']))
elif intervention == "Table_ronde": elif intervention == "Table_ronde":
form.duration.choices = map(lambda d: (d, u'Table ronde (%dh%.2d)' % (d / 60, d % 60)), form.duration.choices = list(map(lambda d: (d, u'Table ronde (%dh%.2d)' % (d / 60, d % 60)),
[60, 90, 120, 150]) [60, 90, 120, 150]))
if not duration in map(lambda d, y: d, form.duration.choices): if not duration in map(lambda d: d[0], form.duration.choices):
form.duration.choices.append((duration, u'Table ronde (%dh%.2d)' % (duration / 60, duration % 60))) form.duration.choices.append((duration, u'Table ronde (%dh%.2d)' % (duration / 60, duration % 60)))
salle_dispo = salle_dispo.filter(Salles.place_type == 'Table ronde') salle_dispo = salle_dispo.filter(Salles.place_type == 'Table ronde')
elif intervention == "Concert": elif intervention == "Concert":
form.duration.choices = map(lambda d: (d, u'Concert (%dh%.2d)' % (d / 60, d % 60)), form.duration.choices = list(map(lambda d: (d, u'Concert (%dh%.2d)' % (d / 60, d % 60)),
[60, 90, 120, 150, 180, 210, 240]) [60, 90, 120, 150, 180, 210, 240]))
if not duration in map(lambda d, y: d, form.duration.choices): if not duration in map(lambda d: d[0], form.duration.choices):
form.duration.choices.append((duration, u'Concert (%dh%.2d)' % (duration / 60, duration % 60))) form.duration.choices.append((duration, u'Concert (%dh%.2d)' % (duration / 60, duration % 60)))
salle_dispo = salle_dispo.filter(Salles.place_type.in_(['Stand', 'MAO'])) salle_dispo = salle_dispo.filter(Salles.place_type.in_(['Stand', 'MAO']))
else: else: