-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add demo users and update the error code
- Loading branch information
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
DataElementAssociationType, | ||
) | ||
from const.schedule import ScheduleTaskType | ||
from const.user import UserGroup | ||
from lib.lineage.utils import lineage as lineage_logic | ||
from logic import ( | ||
admin as admin_logic, | ||
|
@@ -128,6 +129,32 @@ def set_up_demo(uid: int, session=None): | |
} | ||
|
||
|
||
@with_session | ||
def create_demo_users(session=None): | ||
user_logic.create_user( | ||
username="demo-user-1", | ||
password="password", | ||
fullname="Demo User 1", | ||
email="[email protected]", | ||
session=session, | ||
) | ||
user_logic.create_user( | ||
username="demo-user-2", | ||
password="password", | ||
fullname="Demo User 2", | ||
email="[email protected]", | ||
session=session, | ||
) | ||
demo_user_group = UserGroup( | ||
name="demo-group", | ||
display_name="Demo User Group", | ||
description="Demo user group", | ||
email="[email protected]", | ||
members=["demo-user-1", "demo-user-2"], | ||
) | ||
user_logic.create_or_update_user_group(demo_user_group, session=session) | ||
|
||
|
||
@with_session | ||
def create_demo_table_stats(table_id, uid, session=None): | ||
m_logic.upsert_table_stat( | ||
|