clean up and linting

This commit is contained in:
Rachid Mrad 2023-09-29 13:49:15 -04:00
parent 155baa0200
commit ca327fc094
No known key found for this signature in database
GPG key ID: EF38E4CEC4A8F3CF
3 changed files with 9 additions and 6 deletions

View file

@ -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

View file

@ -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,
),

View file

@ -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",
)