-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
43 changed files
with
681 additions
and
549 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
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
9 changes: 1 addition & 8 deletions
9
benefits/core/migrations/0016_refactor_paymentprocessor_transitprocessor.py
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
9 changes: 1 addition & 8 deletions
9
benefits/core/migrations/0017_refactor_authprovider_claimsprovider.py
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
174 changes: 174 additions & 0 deletions
174
benefits/core/migrations/0021_rename_eligibilityverifier_enrollmentflow.py
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,174 @@ | ||
# Generated by Django 5.0.7 on 2024-08-07 21:22 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
import benefits.core.models | ||
import benefits.secrets | ||
from benefits.core.migrations import create_all_permissions | ||
|
||
|
||
def update_permissions(apps, schema_editor): | ||
Group = apps.get_model("auth", "Group") | ||
staff_group = Group.objects.get(name="Cal-ITP") | ||
|
||
Permission = apps.get_model("auth", "Permission") | ||
|
||
remove_permissions = ["Can view", "Can change", "Can add", "Can delete"] | ||
for remove_permission in remove_permissions: | ||
current_permission = Permission.objects.get(name=f"{remove_permission} eligibility verifier") | ||
staff_group.permissions.remove(current_permission) | ||
current_permission.delete() | ||
|
||
add_permissions = ["Can view", "Can change"] | ||
for add_permission in add_permissions: | ||
new_permission = Permission.objects.get(name=f"{add_permission} enrollment flow") | ||
staff_group.permissions.add(new_permission) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("core", "0020_refactor_idg_config_eligibilityverifier"), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameModel( | ||
old_name="EligibilityVerifier", | ||
new_name="EnrollmentFlow", | ||
), | ||
migrations.RenameField( | ||
model_name="transitagency", | ||
old_name="eligibility_verifiers", | ||
new_name="enrollment_flows", | ||
), | ||
migrations.RemoveField( | ||
model_name="enrollmentflow", | ||
name="active", | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="claims_provider", | ||
field=models.ForeignKey( | ||
blank=True, | ||
help_text="An entity that provides claims for eligibility verification for this flow.", | ||
null=True, | ||
on_delete=django.db.models.deletion.PROTECT, | ||
to="core.claimsprovider", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="eligibility_api_auth_header", | ||
field=models.TextField( | ||
blank=True, help_text="The auth header to send in Eligibility API requests for this flow.", null=True | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="eligibility_api_auth_key_secret_name", | ||
field=benefits.core.models.SecretNameField( | ||
blank=True, | ||
help_text="The name of a secret containing the value of the auth header to send in Eligibility API requests for this flow.", # noqa: E501 | ||
max_length=127, | ||
null=True, | ||
validators=[benefits.secrets.SecretNameValidator()], | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="eligibility_api_jwe_cek_enc", | ||
field=models.TextField( | ||
blank=True, | ||
help_text="The JWE-compatible Content Encryption Key (CEK) key-length and mode to use in Eligibility API requests for this flow.", # noqa: E501 | ||
null=True, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="eligibility_api_jwe_encryption_alg", | ||
field=models.TextField( | ||
blank=True, | ||
help_text="The JWE-compatible encryption algorithm to use in Eligibility API requests for this flow.", | ||
null=True, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="eligibility_api_jws_signing_alg", | ||
field=models.TextField( | ||
blank=True, | ||
help_text="The JWS-compatible signing algorithm to use in Eligibility API requests for this flow.", | ||
null=True, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="eligibility_api_public_key", | ||
field=models.ForeignKey( | ||
blank=True, | ||
help_text="The public key used to encrypt Eligibility API requests and to verify signed Eligibility API responses for this flow.", # noqa: E501 | ||
null=True, | ||
on_delete=django.db.models.deletion.PROTECT, | ||
related_name="+", | ||
to="core.pemdata", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="eligibility_api_url", | ||
field=models.TextField( | ||
blank=True, help_text="Fully qualified URL for an Eligibility API server used by this flow.", null=True | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="eligibility_form_class", | ||
field=models.TextField( | ||
blank=True, | ||
help_text="The fully qualified Python path of a form class used by this flow, e.g. benefits.eligibility.forms.FormClass", # noqa: E501 | ||
null=True, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="eligibility_start_template", | ||
field=models.TextField( | ||
default="eligibility/start.html", | ||
help_text="Path to a Django template for the informational page of this flow.", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="eligibility_unverified_template", | ||
field=models.TextField( | ||
default="eligibility/unverified.html", | ||
help_text="Path to a Django template that defines the page when a user fails eligibility verification for this flow.", # noqa: E501 | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="help_template", | ||
field=models.TextField( | ||
blank=True, | ||
help_text="Path to a Django template that defines the help text for this enrollment flow, used in building the dynamic help page for an agency", # noqa: E501 | ||
null=True, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="name", | ||
field=models.TextField( | ||
help_text="Primary internal system name for this EnrollmentFlow instance, e.g. in analytics and Eligibility API requests." # noqa: E501 | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="enrollmentflow", | ||
name="selection_label_template", | ||
field=models.TextField( | ||
help_text="Path to a Django template that defines the end-user UI for selecting this flow among other options." | ||
), | ||
), | ||
migrations.RunPython(create_all_permissions), | ||
migrations.RunPython(update_permissions), | ||
] |
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,8 @@ | ||
from django.contrib.auth.management import create_permissions | ||
|
||
|
||
def create_all_permissions(apps, schema_editor): | ||
for app_config in apps.get_app_configs(): | ||
app_config.models_module = True | ||
create_permissions(app_config, apps=apps, verbosity=0) | ||
app_config.models_module = None |
Oops, something went wrong.