From 81de10b70c85c5222b17d8c4358a8aa8812f2559 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Fri, 18 Nov 2022 08:28:15 -0700 Subject: Migration reset, start of docs, env vars --- users/models/domain.py | 7 +++++-- users/models/password_reset.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'users/models') diff --git a/users/models/domain.py b/users/models/domain.py index 4743503..c238025 100644 --- a/users/models/domain.py +++ b/users/models/domain.py @@ -41,6 +41,9 @@ class Domain(models.Model): # should) public = models.BooleanField(default=False) + # If this is the default domain (shown as the default entry for new users) + default = models.BooleanField(default=False) + # Domains can also be linked to one or more users for their private use # This should be display domains ONLY users = models.ManyToManyField("users.User", related_name="domains", blank=True) @@ -52,7 +55,7 @@ class Domain(models.Model): root = "/admin/domains/" create = "/admin/domains/create/" edit = "/admin/domains/{self.domain}/" - delete = "/admin/domains/{self.domain}/delete/" + delete = "{edit}delete/" @classmethod def get_remote_domain(cls, domain: str) -> "Domain": @@ -81,7 +84,7 @@ class Domain(models.Model): return cls.objects.filter( models.Q(public=True) | models.Q(users__id=user.id), local=True, - ) + ).order_by("-default", "domain") def __str__(self): return self.domain diff --git a/users/models/password_reset.py b/users/models/password_reset.py index 628efa6..290b08d 100644 --- a/users/models/password_reset.py +++ b/users/models/password_reset.py @@ -12,7 +12,7 @@ from stator.models import State, StateField, StateGraph, StatorModel class PasswordResetStates(StateGraph): - new = State(try_interval=3) + new = State(try_interval=300) sent = State() new.transitions_to(sent) -- cgit v1.2.3