mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-16 01:27:03 +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_help_text = "Search by domain name."
|
||||
change_form_template = "django/admin/domain_change_form.html"
|
||||
# readonly_fields = ["state"]
|
||||
readonly_fields = ["state"]
|
||||
|
||||
def response_change(self, request, obj):
|
||||
# Create dictionary of action functions
|
||||
|
|
|
@ -10,10 +10,13 @@
|
|||
|
||||
from django.db import migrations
|
||||
from registrar.models import UserGroup
|
||||
from typing import Any
|
||||
|
||||
def create_groups():
|
||||
UserGroup.create_cisa_analyst_group()
|
||||
UserGroup.create_full_access_group()
|
||||
# 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):
|
||||
|
@ -23,7 +26,7 @@ class Migration(migrations.Migration):
|
|||
|
||||
operations = [
|
||||
migrations.RunPython(
|
||||
create_groups, # noqa
|
||||
create_groups,
|
||||
reverse_code=migrations.RunPython.noop,
|
||||
atomic=True,
|
||||
),
|
||||
|
|
|
@ -675,7 +675,7 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
max_length=21,
|
||||
choices=State.choices,
|
||||
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",
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue