mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-05-24 01:12:54 -04:00
* fix ts types * feat(code-generation): ♻️ update code-generation formats * new scope * add step button * fix linter error * update code-generation tags * feat(backend): ✨ start multi-tenant support * feat(backend): ✨ group invitation token generation and signup * refactor(backend): ♻️ move group admin actions to admin router * set url base to include `/admin` * feat(frontend): ✨ generate user sign-up links * test(backend): ✅ refactor test-suite to further decouple tests (WIP) * feat(backend): 🐛 assign owner on backup import for recipes * fix(backend): 🐛 assign recipe owner on migration from other service Co-authored-by: hay-kot <hay-kot@pm.me>
25 lines
709 B
Python
25 lines
709 B
Python
import random
|
|
import string
|
|
|
|
from mealie.schema.user.registration import CreateUserRegistration
|
|
|
|
|
|
def random_string(length=10) -> str:
|
|
return "".join(random.choice(string.ascii_lowercase + string.digits) for _ in range(length)).strip()
|
|
|
|
|
|
def random_email(length=10) -> str:
|
|
return "".join(random.choice(string.ascii_lowercase + string.digits) for _ in range(length)) + "@fake.com"
|
|
|
|
|
|
def user_registration_factory() -> CreateUserRegistration:
|
|
return CreateUserRegistration(
|
|
group=random_string(),
|
|
email=random_email(),
|
|
username=random_string(),
|
|
password="fake-password",
|
|
password_confirm="fake-password",
|
|
advanced=False,
|
|
private=False,
|
|
)
|