|
@@ -206,17 +206,16 @@ class UserInvite(Model):
|
|
|
|
|
|
@staticmethod
|
|
@staticmethod
|
|
def by_code(token: str) -> "UserInvite":
|
|
def by_code(token: str) -> "UserInvite":
|
|
- if (u := UserInvite.get_or_none(token=token)):
|
|
|
|
|
|
+ if (u := UserInvite.get_or_none(token=token)) :
|
|
return u
|
|
return u
|
|
raise e.NoSuchInvite(invite=token)
|
|
raise e.NoSuchInvite(invite=token)
|
|
|
|
|
|
@staticmethod
|
|
@staticmethod
|
|
def manufacture(creator: User) -> "UserInvite":
|
|
def manufacture(creator: User) -> "UserInvite":
|
|
now = datetime.datetime.now()
|
|
now = datetime.datetime.now()
|
|
- token = c.serializer.dumps({
|
|
|
|
- "created_at": now.timestamp(),
|
|
|
|
- "created_by": creator.name,
|
|
|
|
- })
|
|
|
|
|
|
+ token = c.serializer.dumps(
|
|
|
|
+ {"created_at": now.timestamp(), "created_by": creator.name,}
|
|
|
|
+ )
|
|
return UserInvite.create(
|
|
return UserInvite.create(
|
|
token=token,
|
|
token=token,
|
|
created_by=creator,
|
|
created_by=creator,
|