mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-10 10:03:21 -04:00
1154 - pushing up this change so Ken can take a look
This commit is contained in:
@@ -1239,7 +1239,14 @@ class ChangeNameForm(StripWhitespaceForm):
|
|||||||
class ChangePreferredTimezoneForm(StripWhitespaceForm):
|
class ChangePreferredTimezoneForm(StripWhitespaceForm):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(ChangePreferredTimezoneForm, self).__init__(*args, **kwargs)
|
super(ChangePreferredTimezoneForm, self).__init__(*args, **kwargs)
|
||||||
self.new_preferred_timezone.choices = [
|
|
||||||
|
# Get the current preferred timezone from the form data
|
||||||
|
current_timezone = kwargs.get('obj', None).new_preferred_timezone if 'obj' in kwargs else "US/Eastern"
|
||||||
|
|
||||||
|
# Set the choices
|
||||||
|
self.new_preferred_timezone = GovukRadiosField(
|
||||||
|
label="What timezone would you like to use?",
|
||||||
|
choices=[
|
||||||
("America/Puerto_Rico", "America/Puerto_Rico"),
|
("America/Puerto_Rico", "America/Puerto_Rico"),
|
||||||
("US/Eastern", "US/Eastern"),
|
("US/Eastern", "US/Eastern"),
|
||||||
("US/Central", "US/Central"),
|
("US/Central", "US/Central"),
|
||||||
@@ -1249,14 +1256,12 @@ class ChangePreferredTimezoneForm(StripWhitespaceForm):
|
|||||||
("US/Hawaii", "US/Hawaii"),
|
("US/Hawaii", "US/Hawaii"),
|
||||||
("US/Aleutian", "US/Aleutian"),
|
("US/Aleutian", "US/Aleutian"),
|
||||||
("US/Samoa", "US/Samoa"),
|
("US/Samoa", "US/Samoa"),
|
||||||
]
|
],
|
||||||
|
default=current_timezone
|
||||||
new_preferred_timezone = GovukRadiosField(
|
|
||||||
"What timezone would you like to use?",
|
|
||||||
default="US/Eastern",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ChangeEmailForm(StripWhitespaceForm):
|
class ChangeEmailForm(StripWhitespaceForm):
|
||||||
def __init__(self, validate_email_func, *args, **kwargs):
|
def __init__(self, validate_email_func, *args, **kwargs):
|
||||||
self.validate_email_func = validate_email_func
|
self.validate_email_func = validate_email_func
|
||||||
|
|||||||
Reference in New Issue
Block a user