Skip to content

Commit

Permalink
Fix: some enums display incorrectly on admin panel (#800)
Browse files Browse the repository at this point in the history
* Fix: some enums display incorrectly on admin panel

* Migration
  • Loading branch information
Andrew-Dickinson authored Jan 7, 2025
1 parent c285614 commit 8feaa16
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 20 deletions.
115 changes: 115 additions & 0 deletions src/meshapi/migrations/0004_alter_historicalinstall_status_and_more.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# Generated by Django 4.2.17 on 2025-01-07 00:50

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("meshapi", "0003_alter_historicalinstall_request_date_and_more"),
]

operations = [
migrations.AlterField(
model_name="historicalinstall",
name="status",
field=models.CharField(
choices=[
("Request Received", "Request Received"),
("Pending", "Pending"),
("Blocked", "Blocked"),
("Active", "Active"),
("Inactive", "Inactive"),
("Closed", "Closed"),
("NN Reassigned", "NN Reassigned"),
],
help_text="The current status of this install",
),
),
migrations.AlterField(
model_name="historicallink",
name="type",
field=models.CharField(
blank=True,
choices=[
("5 GHz", "5 GHz"),
("24 GHz", "24 GHz"),
("60 GHz", "60 GHz"),
("70-80 GHz", "70-80 GHz"),
("VPN", "VPN"),
("Fiber", "Fiber"),
("Ethernet", "Ethernet"),
],
default=None,
help_text="The technology used for this link 5Ghz, 60Ghz, fiber, etc.",
null=True,
),
),
migrations.AlterField(
model_name="historicalnode",
name="type",
field=models.CharField(
choices=[
("Standard", "Standard"),
("Hub", "Hub"),
("Supernode", "Supernode"),
("POP", "POP"),
("AP", "AP"),
("Remote", "Remote"),
],
default="Standard",
help_text="The type of node this is, controls the icon used on the network map",
),
),
migrations.AlterField(
model_name="install",
name="status",
field=models.CharField(
choices=[
("Request Received", "Request Received"),
("Pending", "Pending"),
("Blocked", "Blocked"),
("Active", "Active"),
("Inactive", "Inactive"),
("Closed", "Closed"),
("NN Reassigned", "NN Reassigned"),
],
help_text="The current status of this install",
),
),
migrations.AlterField(
model_name="link",
name="type",
field=models.CharField(
blank=True,
choices=[
("5 GHz", "5 GHz"),
("24 GHz", "24 GHz"),
("60 GHz", "60 GHz"),
("70-80 GHz", "70-80 GHz"),
("VPN", "VPN"),
("Fiber", "Fiber"),
("Ethernet", "Ethernet"),
],
default=None,
help_text="The technology used for this link 5Ghz, 60Ghz, fiber, etc.",
null=True,
),
),
migrations.AlterField(
model_name="node",
name="type",
field=models.CharField(
choices=[
("Standard", "Standard"),
("Hub", "Hub"),
("Supernode", "Supernode"),
("POP", "POP"),
("AP", "AP"),
("Remote", "Remote"),
],
default="Standard",
help_text="The type of node this is, controls the icon used on the network map",
),
),
]
14 changes: 7 additions & 7 deletions src/meshapi/models/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ class Meta:
ordering = ["-install_number"]

class InstallStatus(models.TextChoices):
REQUEST_RECEIVED = "Request Received"
PENDING = "Pending"
BLOCKED = "Blocked"
ACTIVE = "Active"
INACTIVE = "Inactive"
CLOSED = "Closed"
NN_REASSIGNED = "NN Reassigned"
REQUEST_RECEIVED = "Request Received", "Request Received"
PENDING = "Pending", "Pending"
BLOCKED = "Blocked", "Blocked"
ACTIVE = "Active", "Active"
INACTIVE = "Inactive", "Inactive"
CLOSED = "Closed", "Closed"
NN_REASSIGNED = "NN Reassigned", "NN Reassigned"

id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)

Expand Down
14 changes: 7 additions & 7 deletions src/meshapi/models/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ class LinkStatus(models.TextChoices):
ACTIVE = "Active"

class LinkType(models.TextChoices):
FIVE_GHZ = "5 GHz"
TWENTYFOUR_GHZ = "24 GHz"
SIXTY_GHZ = "60 GHz"
SEVENTY_EIGHTY_GHZ = "70-80 GHz"
VPN = "VPN"
FIBER = "Fiber"
ETHERNET = "Ethernet"
FIVE_GHZ = "5 GHz", "5 GHz"
TWENTYFOUR_GHZ = "24 GHz", "24 GHz"
SIXTY_GHZ = "60 GHz", "60 GHz"
SEVENTY_EIGHTY_GHZ = "70-80 GHz", "70-80 GHz"
VPN = "VPN", "VPN"
FIBER = "Fiber", "Fiber"
ETHERNET = "Ethernet", "Ethernet"

class Meta:
ordering = ["id"]
Expand Down
12 changes: 6 additions & 6 deletions src/meshapi/models/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ class NodeStatus(models.TextChoices):
PLANNED = "Planned"

class NodeType(models.TextChoices):
STANDARD = "Standard"
HUB = "Hub"
SUPERNODE = "Supernode"
POP = "POP"
AP = "AP"
REMOTE = "Remote"
STANDARD = "Standard", "Standard"
HUB = "Hub", "Hub"
SUPERNODE = "Supernode", "Supernode"
POP = "POP", "POP"
AP = "AP", "AP"
REMOTE = "Remote", "Remote"

id = models.UUIDField(primary_key=True, default=uuid.uuid4)

Expand Down

0 comments on commit 8feaa16

Please sign in to comment.