From fb469545b48cc09c6441fd8ecaaddd645f7bd1e5 Mon Sep 17 00:00:00 2001 From: Jonathan Bobel Date: Thu, 8 Feb 2024 12:09:01 -0500 Subject: [PATCH 1/3] 1154 - pushing up this change so Ken can take a look --- app/main/forms.py | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/app/main/forms.py b/app/main/forms.py index d9a35b72a..6f22734d2 100644 --- a/app/main/forms.py +++ b/app/main/forms.py @@ -1239,22 +1239,27 @@ class ChangeNameForm(StripWhitespaceForm): class ChangePreferredTimezoneForm(StripWhitespaceForm): def __init__(self, *args, **kwargs): super(ChangePreferredTimezoneForm, self).__init__(*args, **kwargs) - self.new_preferred_timezone.choices = [ - ("America/Puerto_Rico", "America/Puerto_Rico"), - ("US/Eastern", "US/Eastern"), - ("US/Central", "US/Central"), - ("US/Mountain", "US/Mountain"), - ("US/Pacific", "US/Pacific"), - ("US/Alaska", "US/Alaska"), - ("US/Hawaii", "US/Hawaii"), - ("US/Aleutian", "US/Aleutian"), - ("US/Samoa", "US/Samoa"), - ] - new_preferred_timezone = GovukRadiosField( - "What timezone would you like to use?", - default="US/Eastern", - ) + # 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"), + ("US/Eastern", "US/Eastern"), + ("US/Central", "US/Central"), + ("US/Mountain", "US/Mountain"), + ("US/Pacific", "US/Pacific"), + ("US/Alaska", "US/Alaska"), + ("US/Hawaii", "US/Hawaii"), + ("US/Aleutian", "US/Aleutian"), + ("US/Samoa", "US/Samoa"), + ], + default=current_timezone + ) + class ChangeEmailForm(StripWhitespaceForm): From 7832797628acee9a7e976f6abc892f4d284af469 Mon Sep 17 00:00:00 2001 From: Jonathan Bobel Date: Thu, 8 Feb 2024 15:10:07 -0500 Subject: [PATCH 2/3] Just removing the default selection --- app/main/forms.py | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/app/main/forms.py b/app/main/forms.py index 6f22734d2..93ccd8a55 100644 --- a/app/main/forms.py +++ b/app/main/forms.py @@ -1239,27 +1239,21 @@ class ChangeNameForm(StripWhitespaceForm): class ChangePreferredTimezoneForm(StripWhitespaceForm): def __init__(self, *args, **kwargs): super(ChangePreferredTimezoneForm, self).__init__(*args, **kwargs) + self.new_preferred_timezone.choices = [ + ("America/Puerto_Rico", "America/Puerto_Rico"), + ("US/Eastern", "US/Eastern"), + ("US/Central", "US/Central"), + ("US/Mountain", "US/Mountain"), + ("US/Pacific", "US/Pacific"), + ("US/Alaska", "US/Alaska"), + ("US/Hawaii", "US/Hawaii"), + ("US/Aleutian", "US/Aleutian"), + ("US/Samoa", "US/Samoa"), + ] - # 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"), - ("US/Eastern", "US/Eastern"), - ("US/Central", "US/Central"), - ("US/Mountain", "US/Mountain"), - ("US/Pacific", "US/Pacific"), - ("US/Alaska", "US/Alaska"), - ("US/Hawaii", "US/Hawaii"), - ("US/Aleutian", "US/Aleutian"), - ("US/Samoa", "US/Samoa"), - ], - default=current_timezone - ) - + new_preferred_timezone = GovukRadiosField( + "What timezone would you like to use?", + ) class ChangeEmailForm(StripWhitespaceForm): From 48f1c7c8647227bdefe66f6f2de49cb4a7d3d7e7 Mon Sep 17 00:00:00 2001 From: Carlo Costino Date: Fri, 9 Feb 2024 17:43:01 -0500 Subject: [PATCH 3/3] Admin: Add a pull request template This changeset adds a template to the repository for our pull requests. The intention is two-fold: - To make it easier to know what information and details to include in our pull requests - To improve the quality and usefulness of our pull requests This is a start and we will be adjusting this over time as we learn more and refine our process. Signed-off-by: Carlo Costino --- .github/pull_request_template.md | 79 ++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..cb6b2c84b --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,79 @@ + + +*A note to PR reviewers: it may be helpful to review our +[code review documentation](https://github.com/GSA/notifications-api/blob/main/docs/all.md#code-reviews) +to know what to keep in mind while reviewing pull requests.* + +## Description + +Please enter a clear description about your proposed changes and what the +expected outcome(s) is/are from there. If there are complex implementation +details within the changes, this is a great place to explain those details using +plain language. + +This should include: + +- Links to issues that this PR addresses +- Screenshots or screen captures of any visible changes, especially for UI work +- Dependency changes + +If there are any caveats, known issues, follow-up items, etc., make a quick note +of them here as well, though more details are probably warranted in the issue +itself in this case. + +## TODO (optional) + +If you're opening a draft PR, it might be helpful to list any outstanding work, +especially if you're asking folks to take a look before it's ready for full +review. In this case, create a small checklist with the outstanding items: + +- [ ] TODO item 1 +- [ ] TODO item 2 +- [ ] TODO item ... + +## Security Considerations + +Please think about the security compliance aspect of your changes and what the +potential impacts might be. + +**NOTE: Please be mindful of sharing sensitive information here! If you're not +sure of what to write, please ask the team first before writing anything here.** + +Relevant details could include (and are not limited to) the following: + +- Handling secrets/credential management (or specifically calling out that there + is nothing to handle) +- Any adjustments to the flow of data in and out the system, or even within it +- Connecting or disconnecting any external services to the application +- Handling of any sensitive information, such as PII +- Handling of information within log statements or other application monitoring + services/hooks +- The inclusion of a new external dependency or the removal of an existing one +- ... (anything else relevant from a security compliance perspective) + +There are some cases where there are no security considerations to be had, e.g., +updating our documentation with publicly available information. In those cases +it is fine to simply put something like this: + +- None; this is a documentation update with publicly available information.