Queue local website activation from Apache previews
This commit is contained in:
1 parent
7f706c39b5
commit
6523c166a8
12 files changed
+459
-3
No files matched your search
@@ -2,6 +2,7 @@ from django.conf import settings
|
||||
from django.core.validators import RegexValidator
|
||||
from django.db import models
|
||||
from django.urls import reverse
|
||||
from django.utils import timezone
|
||||
|
||||
from coulobre.database_node import DATABASE_SUFFIX_PATTERN, INVALID_SUFFIX, DatabaseSpec
|
||||
from coulobre.dns_node import (
|
||||
@@ -222,3 +223,20 @@ class WebProvisioningPlan(models.Model):
|
||||
|
||||
def __str__(self):
|
||||
return str(self.primary_domain)
|
||||
|
||||
|
||||
class WebActivation(models.Model):
|
||||
plan = models.OneToOneField(
|
||||
WebProvisioningPlan, on_delete=models.CASCADE, related_name="activation"
|
||||
)
|
||||
requested_at = models.DateTimeField(default=timezone.now)
|
||||
last_dispatched_at = models.DateTimeField(null=True, blank=True)
|
||||
started_at = models.DateTimeField(null=True, blank=True)
|
||||
finished_at = models.DateTimeField(null=True, blank=True)
|
||||
problem = models.TextField(blank=True)
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
if self.finished_at is not None:
|
||||
return "failed" if self.problem else "configured"
|
||||
return "running" if self.started_at else "queued"
|
||||
Reference in new issue
Block a user