-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from LandRegistry/govuk-frontend-45
GOV.UK Frontend 4.5.0
- Loading branch information
Showing
24 changed files
with
1,100 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from flask import Blueprint | ||
|
||
bp = Blueprint("demos", __name__, template_folder="../templates/demos") | ||
|
||
from app.demos import routes # noqa: E402,F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from wtforms.validators import InputRequired | ||
|
||
|
||
class RequiredIf(InputRequired): | ||
def __init__(self, other_field_name, other_field_value, *args, **kwargs): | ||
self.other_field_name = other_field_name | ||
self.other_field_value = other_field_value | ||
|
||
super(RequiredIf, self).__init__(*args, **kwargs) | ||
|
||
def __call__(self, form, field): | ||
other_field = form._fields.get(self.other_field_name) | ||
|
||
if other_field is None: | ||
raise Exception('no field named "%s" in form' % self.other_field_name) | ||
|
||
if other_field.data == self.other_field_value: | ||
super(RequiredIf, self).__call__(form, field) |
Oops, something went wrong.