Improve panel navigation, invitations, themes, and account setup
This commit is contained in:
1 parent
570addf37a
commit
ddec53170b
46 files changed
+1856
-199
No files matched your search
@@ -73,6 +73,29 @@ class Reseller(models.Model):
|
||||
return self.account_limit > 0 and self.hosting_plans.exists()
|
||||
|
||||
|
||||
class ResellerProfile(models.Model):
|
||||
name = models.CharField(max_length=120, unique=True)
|
||||
account_limit = models.PositiveIntegerField()
|
||||
manage_resources = models.BooleanField(default=False)
|
||||
hosting_plans = models.ManyToManyField("HostingPlan", blank=True)
|
||||
default_slot = models.PositiveSmallIntegerField(
|
||||
unique=True, null=True, editable=False
|
||||
)
|
||||
|
||||
class Meta:
|
||||
ordering = ("name",)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
def policy(self):
|
||||
return {
|
||||
"account_limit": self.account_limit,
|
||||
"hosting_plans": self.hosting_plans.all(),
|
||||
"manage_resources": self.manage_resources,
|
||||
}
|
||||
|
||||
|
||||
class ResellerAuditEvent(models.Model):
|
||||
class Action(models.TextChoices):
|
||||
CREATE = "create", "Created reseller"
|
||||
@@ -136,6 +159,25 @@ class Customer(models.Model):
|
||||
)
|
||||
|
||||
|
||||
class PanelInvitation(models.Model):
|
||||
class Delivery(models.TextChoices):
|
||||
PENDING = "pending", "Waiting to send"
|
||||
SENT = "sent", "Sent"
|
||||
FAILED = "failed", "Delivery failed"
|
||||
UNAVAILABLE = "unavailable", "Email delivery is not configured"
|
||||
|
||||
user = models.OneToOneField(
|
||||
settings.AUTH_USER_MODEL,
|
||||
on_delete=models.CASCADE,
|
||||
related_name="panel_invitation",
|
||||
)
|
||||
revision = models.UUIDField(default=uuid.uuid4)
|
||||
created_at = models.DateTimeField(default=timezone.now)
|
||||
delivery = models.CharField(
|
||||
max_length=11, choices=Delivery, default=Delivery.PENDING
|
||||
)
|
||||
|
||||
|
||||
class CustomerImpersonation(models.Model):
|
||||
class EndReason(models.TextChoices):
|
||||
STOPPED = "stopped", "Ended by administrator"
|
||||
@@ -858,6 +900,7 @@ class WebActivation(ProvisioningJob):
|
||||
|
||||
php_settings = models.JSONField(null=True, blank=True)
|
||||
applied_php_version = models.CharField(max_length=5, blank=True)
|
||||
starter_page = models.BooleanField(default=False)
|
||||
|
||||
|
||||
class SitePhpVersion(ProvisioningJob):
|
||||
@@ -912,6 +955,8 @@ class WebHTTPS(ProvisioningJob):
|
||||
|
||||
|
||||
class WebsiteAlias(ProvisioningJob):
|
||||
wait_for_website = models.BooleanField(default=False)
|
||||
|
||||
class Operation(models.TextChoices):
|
||||
ACTIVATE = "activate", "Activate alias"
|
||||
HTTPS = "https", "Enable HTTPS"
|
||||
|
||||
Reference in new issue
Block a user