<commit_before>from flask.ext.babel import lazy_gettext as l_
from flask_wtf import Form

from wtforms import TextField
from wtforms.validators import Length

from skylines.forms.pilot import ClubPilotsSelectField
from skylines.forms.aircraft_model import AircraftModelSelectField


class ChangePilotsForm(Form):
    pilot_id = ClubPilotsSelectField(l_('Pilot'))
    co_pilot_id = ClubPilotsSelectField(l_('Co-Pilot'))


class ChangeAircraftForm(Form):
    model_id = AircraftModelSelectField(l_('Aircraft Model'))
    registration = TextField(l_('Aircraft Registration'), validators=[
        Length(max=32),
    ])
    competition_id = TextField(l_('Competition Number'), validators=[
        Length(max=5),
    ])<commit_msg>forms/flight: Check that pilot and co-pilot are not the same<commit_after>from flask.ext.babel import lazy_gettext as l_
from flask_wtf import Form

from wtforms import TextField
from wtforms.validators import Length

from skylines.forms.pilot import ClubPilotsSelectField
from skylines.forms.aircraft_model import AircraftModelSelectField
from skylines.forms.validators import NotEqualTo


class ChangePilotsForm(Form):
    pilot_id = ClubPilotsSelectField(l_('Pilot'))
    co_pilot_id = ClubPilotsSelectField(l_('Co-Pilot'), validators=[
        NotEqualTo('pilot_id', message=l_('Pilot and co-pilot can not be the same person.')),
    ])


class ChangeAircraftForm(Form):
    model_id = AircraftModelSelectField(l_('Aircraft Model'))
    registration = TextField(l_('Aircraft Registration'), validators=[
        Length(max=32),
    ])
    competition_id = TextField(l_('Competition Number'), validators=[
        Length(max=5),
    ])
{'fraction_non_alphanumeric': 0.09483793517406963, 'fraction_numerical': 0.003601440576230492, 'mean_word_length': 5.2669172932330826, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6404300', 'n_tokens_mistral': 547, 'n_tokens_neox': 514, 'n_words': 118}