forked from Github-Mirrors/canaille
fix: demo user initialization
This commit is contained in:
parent
ff2ff68023
commit
4528526de4
1 changed files with 7 additions and 4 deletions
|
@ -16,6 +16,9 @@ def populate(app):
|
||||||
|
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
with app.backend.session():
|
with app.backend.session():
|
||||||
|
if models.User.query():
|
||||||
|
return
|
||||||
|
|
||||||
jane = models.User(
|
jane = models.User(
|
||||||
formatted_name="Jane Doe",
|
formatted_name="Jane Doe",
|
||||||
given_name="Jane",
|
given_name="Jane",
|
||||||
|
@ -29,10 +32,10 @@ def populate(app):
|
||||||
formatted_address="123, Admin Lane - Gotham City 12345",
|
formatted_address="123, Admin Lane - Gotham City 12345",
|
||||||
street="Admin Lane",
|
street="Admin Lane",
|
||||||
postal_code="12345",
|
postal_code="12345",
|
||||||
city="Gotham City",
|
locality="Gotham City",
|
||||||
region="North Pole",
|
region="North Pole",
|
||||||
employee_number="1000",
|
employee_number="1000",
|
||||||
department_number="east",
|
department="east",
|
||||||
)
|
)
|
||||||
jane.save()
|
jane.save()
|
||||||
|
|
||||||
|
@ -47,7 +50,7 @@ def populate(app):
|
||||||
phone_numbers=["555-000-002"],
|
phone_numbers=["555-000-002"],
|
||||||
profile_url="https://moderator.example",
|
profile_url="https://moderator.example",
|
||||||
employee_number="1002",
|
employee_number="1002",
|
||||||
department_number="west",
|
department="west",
|
||||||
)
|
)
|
||||||
jack.save()
|
jack.save()
|
||||||
|
|
||||||
|
@ -62,7 +65,7 @@ def populate(app):
|
||||||
phone_numbers=["555-000-001"],
|
phone_numbers=["555-000-001"],
|
||||||
profile_url="https://user.example",
|
profile_url="https://user.example",
|
||||||
employee_number="1001",
|
employee_number="1001",
|
||||||
department_number="west",
|
department="west",
|
||||||
)
|
)
|
||||||
john.save()
|
john.save()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue