'Parse year_of_birth to an integer, but just use None instead of raising
an error if it is malformed'

def clean_year_of_birth(self):

    try:
        year_str = self.cleaned_data['year_of_birth']
        return (int(year_str) if (year_str is not None) else None)
    except ValueError:
        return None
