-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: Cal-ITP staff can add EnrollmentFlow #2654
Draft
angela-tran
wants to merge
13
commits into
main
Choose a base branch
from
feat/staff-add-enrollmentflow
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+397
−156
Conversation
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
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
github-actions
bot
added
back-end
Django views, sessions, middleware, models, migrations etc.
tests
Related to automated testing (unit, UI, integration, etc.)
and removed
back-end
Django views, sessions, middleware, models, migrations etc.
labels
Jan 30, 2025
angela-tran
force-pushed
the
feat/staff-add-enrollmentflow
branch
2 times, most recently
from
January 30, 2025 21:43
42ec34f
to
c28fdab
Compare
angela-tran
commented
Jan 30, 2025
angela-tran
commented
Jan 30, 2025
we are just adding / updating permissions for staff members
angela-tran
force-pushed
the
feat/staff-add-enrollmentflow
branch
from
January 30, 2025 22:36
e41efcf
to
7bc6687
Compare
angela-tran
commented
Jan 30, 2025
angela-tran
force-pushed
the
feat/staff-add-enrollmentflow
branch
from
January 31, 2025 21:29
3aff591
to
a7d846f
Compare
3 tasks
angela-tran
added a commit
that referenced
this pull request
Feb 3, 2025
even if the EnrollmentFlow is not fully configured, we want the staff member to be able to save whatever they have so far. the test uses the same `ModelForm` class that the `SortableEnrollmentFlowAdmin` will provide to the admin interface.
we would want the form to show the user helpful error messages, telling them what is missing. these tests are asserting the desired behavior, but they're currently failing and show that our validation logic will raise a ValueError when it tries to add field-level ValidationErrors. this is because the validation is trying to tell the form about field-level errors, but the staff member's form doesn't even show some of those fields.
prevents an error in the admin for the following use-case: * non-superuser, member of the Cal-ITP Staff group * create a new EnrollmentFlow * assign a TransitAgency * save before this commit, clean() threw a validation error as the eligibility_api_url and eligibility_form_class fields were both: * required * read-only for this user type this commit changes the clean() validation to only check for API fields when the flow actually uses API verification
inverts the logic on a number of checks, where the special case is using Eligibility API verification, and the base case is using claims
refine the tests to show that there is still incorrect behavior, namely that as long as there are no template errors, the model validation allows an incomplete EnrollmentFlow to be saved with a transit agency.
angela-tran
force-pushed
the
feat/staff-add-enrollmentflow
branch
from
February 6, 2025 00:41
5229140
to
05d9ad5
Compare
this is solely a code refactor. this doesn't change the behavior of the bug. remove tests that were for model validation logic that's been moved to the form.
the EnrollmentFlowForm will raise an error if a staff member tries to save an incomplete EnrollmentFlow with an agency
show them the field name for the fields they can't edit and are missing
I just have one more test to fix 💪 😤 It's The test needs to be refactored to go through forms rather than models so that it more accurately captures the validation process. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Part of #2201
Allows Cal-ITP staff members to add new
EnrollmentFlow
objects.