mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-16 17:47:02 +02:00
clean up and linting
This commit is contained in:
parent
155baa0200
commit
ca327fc094
3 changed files with 9 additions and 6 deletions
|
@ -710,7 +710,7 @@ class DomainAdmin(ListHeaderAdmin):
|
||||||
search_fields = ["name"]
|
search_fields = ["name"]
|
||||||
search_help_text = "Search by domain name."
|
search_help_text = "Search by domain name."
|
||||||
change_form_template = "django/admin/domain_change_form.html"
|
change_form_template = "django/admin/domain_change_form.html"
|
||||||
# readonly_fields = ["state"]
|
readonly_fields = ["state"]
|
||||||
|
|
||||||
def response_change(self, request, obj):
|
def response_change(self, request, obj):
|
||||||
# Create dictionary of action functions
|
# Create dictionary of action functions
|
||||||
|
|
|
@ -10,10 +10,13 @@
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
from registrar.models import UserGroup
|
from registrar.models import UserGroup
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
def create_groups():
|
# For linting: RunPython expects a function reference,
|
||||||
UserGroup.create_cisa_analyst_group()
|
# so let's give it one
|
||||||
UserGroup.create_full_access_group()
|
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):
|
class Migration(migrations.Migration):
|
||||||
|
@ -23,7 +26,7 @@ class Migration(migrations.Migration):
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.RunPython(
|
migrations.RunPython(
|
||||||
create_groups, # noqa
|
create_groups,
|
||||||
reverse_code=migrations.RunPython.noop,
|
reverse_code=migrations.RunPython.noop,
|
||||||
atomic=True,
|
atomic=True,
|
||||||
),
|
),
|
||||||
|
|
|
@ -675,7 +675,7 @@ class Domain(TimeStampedModel, DomainHelper):
|
||||||
max_length=21,
|
max_length=21,
|
||||||
choices=State.choices,
|
choices=State.choices,
|
||||||
default=State.UNKNOWN,
|
default=State.UNKNOWN,
|
||||||
protected=False, # cannot change state directly, particularly in Django admin
|
protected=True, # cannot change state directly, particularly in Django admin
|
||||||
help_text="Very basic info about the lifecycle of this domain object",
|
help_text="Very basic info about the lifecycle of this domain object",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue