Part of lp.app.validators
Function | can_be_nominated_for_series | Can the bug be nominated for these series? |
Function | valid_bug_number | Undocumented |
Function | valid_cve_sequence | Check if the given value is a valid CVE otherwise raise an exception. |
Function | validate_new_team_email | Check that the given email is valid and not registered to |
Function | validate_new_person_email | Check that the given email is valid and not registered to |
Function | validate_date_interval | Check if start_date precedes end_date. |
Function | _validate_email | Undocumented |
Function | _check_email_availability | Undocumented |
This validator is supposed to be used only when creating a new profile using the /people/+newperson page, as the message will say clearly to the user that the profile they're trying to create already exists, so there's no need to create another one.
Check if start_date precedes end_date.
>>> from datetime import datetime >>> start = datetime(2006, 7, 18) >>> end = datetime(2006, 8, 18) >>> validate_date_interval(start, end) >>> validate_date_interval(end, start) Traceback (most recent call last): ... WidgetsError: LaunchpadValidationError: This event can't start after it ends. >>> validate_date_interval(end, start, error_msg="A custom error msg") Traceback (most recent call last): ... WidgetsError: LaunchpadValidationError: A custom error msg