summaryrefslogtreecommitdiffstats
path: root/users/models
diff options
context:
space:
mode:
authorAndrew Godwin2022-11-18 08:28:15 -0700
committerAndrew Godwin2022-11-18 11:28:16 -0700
commit81de10b70c85c5222b17d8c4358a8aa8812f2559 (patch)
tree8e028b62d3a883294caedc82c5870f23273e2032 /users/models
parent1b44a253316a84f40070264ea8134c86d1223441 (diff)
downloadtakahe-81de10b70c85c5222b17d8c4358a8aa8812f2559.tar.gz
takahe-81de10b70c85c5222b17d8c4358a8aa8812f2559.tar.bz2
takahe-81de10b70c85c5222b17d8c4358a8aa8812f2559.zip
Migration reset, start of docs, env vars
Diffstat (limited to 'users/models')
-rw-r--r--users/models/domain.py7
-rw-r--r--users/models/password_reset.py2
2 files changed, 6 insertions, 3 deletions
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)