-
Notifications
You must be signed in to change notification settings - Fork 18
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 #1709 from cisagov/ab/1708-vip-table-to-verified-b…
…y-staff 1708: Change VIP table to Verified by staff
- Loading branch information
Showing
10 changed files
with
82 additions
and
22 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
20 changes: 20 additions & 0 deletions
20
src/registrar/migrations/0066_rename_veryimportantperson_verifiedbystaff_and_more.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,20 @@ | ||
# Generated by Django 4.2.7 on 2024-01-29 22:21 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("registrar", "0065_create_groups_v06"), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameModel( | ||
old_name="VeryImportantPerson", | ||
new_name="VerifiedByStaff", | ||
), | ||
migrations.AlterModelOptions( | ||
name="verifiedbystaff", | ||
options={"verbose_name_plural": "Verified by staff"}, | ||
), | ||
] |
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,37 @@ | ||
# This migration creates the create_full_access_group and create_cisa_analyst_group groups | ||
# It is dependent on 0035 (which populates ContentType and Permissions) | ||
# If permissions on the groups need changing, edit CISA_ANALYST_GROUP_PERMISSIONS | ||
# in the user_group model then: | ||
# [NOT RECOMMENDED] | ||
# step 1: docker-compose exec app ./manage.py migrate --fake registrar 0035_contenttypes_permissions | ||
# step 2: docker-compose exec app ./manage.py migrate registrar 0036_create_groups | ||
# step 3: fake run the latest migration in the migrations list | ||
# [RECOMMENDED] | ||
# Alternatively: | ||
# step 1: duplicate the migration that loads data | ||
# step 2: docker-compose exec app ./manage.py migrate | ||
|
||
from django.db import migrations | ||
from registrar.models import UserGroup | ||
from typing import Any | ||
|
||
|
||
# For linting: RunPython expects a function reference, | ||
# so let's give it one | ||
def create_groups(apps, schema_editor) -> Any: | ||
UserGroup.create_cisa_analyst_group(apps, schema_editor) | ||
UserGroup.create_full_access_group(apps, schema_editor) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("registrar", "0066_rename_veryimportantperson_verifiedbystaff_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython( | ||
create_groups, | ||
reverse_code=migrations.RunPython.noop, | ||
atomic=True, | ||
), | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,11 +14,11 @@ | |
ContactAdmin, | ||
DomainInformationAdmin, | ||
UserDomainRoleAdmin, | ||
VeryImportantPersonAdmin, | ||
VerifiedByStaffAdmin, | ||
) | ||
from registrar.models import Domain, DomainApplication, DomainInformation, User, DomainInvitation, Contact, Website | ||
from registrar.models.user_domain_role import UserDomainRole | ||
from registrar.models.very_important_person import VeryImportantPerson | ||
from registrar.models.verified_by_staff import VerifiedByStaff | ||
from .common import ( | ||
MockSESClient, | ||
AuditedAdminMockData, | ||
|
@@ -1820,7 +1820,7 @@ def tearDown(self): | |
User.objects.all().delete() | ||
|
||
|
||
class VeryImportantPersonAdminTestCase(TestCase): | ||
class VerifiedByStaffAdminTestCase(TestCase): | ||
def setUp(self): | ||
self.superuser = create_superuser() | ||
self.factory = RequestFactory() | ||
|
@@ -1829,13 +1829,13 @@ def test_save_model_sets_user_field(self): | |
self.client.force_login(self.superuser) | ||
|
||
# Create an instance of the admin class | ||
admin_instance = VeryImportantPersonAdmin(model=VeryImportantPerson, admin_site=None) | ||
admin_instance = VerifiedByStaffAdmin(model=VerifiedByStaff, admin_site=None) | ||
|
||
# Create a VeryImportantPerson instance | ||
vip_instance = VeryImportantPerson(email="[email protected]", notes="Test Notes") | ||
# Create a VerifiedByStaff instance | ||
vip_instance = VerifiedByStaff(email="[email protected]", notes="Test Notes") | ||
|
||
# Create a request object | ||
request = self.factory.post("/admin/yourapp/veryimportantperson/add/") | ||
request = self.factory.post("/admin/yourapp/VerifiedByStaff/add/") | ||
request.user = self.superuser | ||
|
||
# Call the save_model method | ||
|
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