<commit_before>from flask_wtf import Form
from wtforms import StringField, HiddenField, BooleanField, DateField
from wtforms.validators import DataRequired
from fields import CountriesField
from datetime import date
from wtforms.validators import ValidationError


class ValidateDateNotInFuture(object):
    def __init__(self):
        self.message = "The date must not be in the future"

    def __call__(self, form, field):
        self._validate_date_not_in_future(form, field.data)

    def _validate_date_not_in_future(self, form, date_field):
        if date_field > date.today():
            raise ValidationError('Date cannot be in the future')


class ChangeForm(Form):

    title_number = HiddenField('Title Number')

    confirm = BooleanField('Confirm')
    proprietor_firstname = HiddenField('First name')
    proprietor_previous_surname = HiddenField('Previous surname')
    proprietor_new_surname = StringField('New surname', validators=[DataRequired()])
    partner_name = StringField('Partner\'s full name', validators=[DataRequired()])
    marriage_date = DateField('Date of marriage', format='%Y-%m-%d', validators=[DataRequired(), ValidateDateNotInFuture()])
    marriage_place = StringField('Location of marriage ceremony', validators=[DataRequired()])
    marriage_country = CountriesField('Country of marriage ceremony', validators=[DataRequired()], top_countries=['GB'])
    marriage_certificate_number = StringField('Marriage certificate number', validators=[DataRequired()])

<commit_msg>Removed country drop down temporarily. It is not working properly.<commit_after>from flask_wtf import Form
from wtforms import StringField, HiddenField, BooleanField, DateField
from wtforms.validators import DataRequired
from fields import CountriesField
from datetime import date
from wtforms.validators import ValidationError


class ValidateDateNotInFuture(object):
    def __init__(self):
        self.message = "The date must not be in the future"

    def __call__(self, form, field):
        self._validate_date_not_in_future(form, field.data)

    def _validate_date_not_in_future(self, form, date_field):
        if date_field > date.today():
            raise ValidationError('Date cannot be in the future')


class ChangeForm(Form):

    title_number = HiddenField('Title Number')

    confirm = BooleanField('Confirm')
    proprietor_firstname = HiddenField('First name')
    proprietor_previous_surname = HiddenField('Previous surname')
    proprietor_new_surname = StringField('New surname', validators=[DataRequired()])
    partner_name = StringField('Partner\'s full name', validators=[DataRequired()])
    marriage_date = DateField('Date of marriage', format='%Y-%m-%d', validators=[DataRequired(), ValidateDateNotInFuture()])
    marriage_place = StringField('Location of marriage ceremony', validators=[DataRequired()])
    #marriage_country = CountriesField('Country of marriage ceremony', validators=[DataRequired()], top_countries=['GB'])
    marriage_country = StringField('Country of marriage ceremony', validators=[DataRequired()])
    marriage_certificate_number = StringField('Marriage certificate number', validators=[DataRequired()])


{'fraction_non_alphanumeric': 0.09943360604153556, 'fraction_numerical': 0.0, 'mean_word_length': 5.72093023255814, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6767124', 'n_tokens_mistral': 863, 'n_tokens_neox': 845, 'n_words': 231}