#NEWLINE# def update_vacancy( self ) : #NEWLINE# #INDENT# '\n        Checks how many seats are still available in car and updates the attribute consistently\n        ' #NEWLINE# participations_for_trip = self . get_participations ( ) . exclude ( role = 'driver' ) . filter ( started = True ) . filter ( finished = False ) . count ( ) #NEWLINE# vacancy = ( self . modality . capacity - participations_for_trip ) #NEWLINE# if ( self . modality . vacancy != vacancy ) : #NEWLINE# #INDENT# self . modality . vacancy = vacancy #NEWLINE# self . modality . save ( )