Allow reseller account creation within assigned limits
This commit is contained in:
1 parent
39243a8ab3
commit
4a96829adc
8 files changed
+250
-12
No files matched your search
@@ -12,6 +12,11 @@ class Reseller(models.Model):
|
||||
related_name="hosting_reseller",
|
||||
limit_choices_to={"is_superuser": False},
|
||||
)
|
||||
account_limit = models.PositiveIntegerField(default=0)
|
||||
hosting_plans = models.ManyToManyField("HostingPlan", blank=True)
|
||||
|
||||
def may_create_accounts(self):
|
||||
return self.account_limit > 0 and self.hosting_plans.exists()
|
||||
|
||||
def __str__(self):
|
||||
return self.user.get_username()
|
||||
|
||||
Reference in new issue
Block a user