1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-10 04:06:47 +00:00

refactor: settings are read through django.conf

instances/forms.py and instances/models.py imported values from the
webvirtcloud.settings module itself, which bypasses DJANGO_SETTINGS_MODULE
(settings-dev, test overrides) and runs the module a second time. They
now read django.conf.settings. webvirtcloud/urls.py also loses its
fallback that set REST_FRAMEWORK's schema class at import for settings.py
copies without it: the template sets it, and an older settings.py is
rebuilt from the template when updating.
This commit is contained in:
catborise 2026-11-06 11:01:51 +03:00
parent 2440c9eaf7
commit abe3b7ee63
3 changed files with 4 additions and 16 deletions

View file

@ -1,4 +1,5 @@
from computes.models import Compute
from django.conf import settings
from django.core.validators import MinValueValidator
from django.db import models
from django.utils.functional import cached_property
@ -11,7 +12,6 @@ from libvirt import (
from operations import claims
from operations.models import Claim
from vrtManager.instance import PERSISTENT_XML, wvmInstance
from webvirtcloud.settings import QEMU_CONSOLE_LISTENER_ADDRESSES
class Flavor(models.Model):
@ -466,7 +466,7 @@ class CreateInstance(models.Model):
max_length=16, error_messages={"required": _("Please select a video driver")}
)
listener_addr = models.CharField(
max_length=20, choices=QEMU_CONSOLE_LISTENER_ADDRESSES
max_length=20, choices=settings.QEMU_CONSOLE_LISTENER_ADDRESSES
)
class Meta: