···9191 self.fields['residence'].queryset = Residence.objects.filter(user=self.user)
9292 self.fields['transport'].queryset = Transport.objects.filter(user=self.user)
93939494+ def clean_free_places(self):
9595+ free_places = self.cleaned_data["free_places"]
9696+ transport = self.cleaned_data["transport"]
9797+ if transport is not None and free_places > transport.default_places:
9898+ raise forms.ValidationError(_("No puedes ofertar más plazas que las que tienes en el transporte"))
9999+ return free_places
100100+94101 def clean_departure(self):
95102 departure = self.cleaned_data["departure"]
96103 time_window = self.cleaned_data.get("time_window", 30)