diff options
author | Frederick Muriuki Muriithi | 2023-03-10 04:23:58 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2023-03-10 04:23:58 +0300 |
commit | baef6481ac5eb6ab8cd8196637894b794e44283b (patch) | |
tree | 43b5e4b8b7dbf0a41a2b988ffb3a1e29897ff4af /gn3/auth/authorisation/data | |
parent | 726460a2ca4817a1b7a5c7798147996d7b7e5e2d (diff) | |
download | genenetwork3-baef6481ac5eb6ab8cd8196637894b794e44283b.tar.gz |
auth: data-migration: Fix minor bugs
Diffstat (limited to 'gn3/auth/authorisation/data')
-rw-r--r-- | gn3/auth/authorisation/data/views.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gn3/auth/authorisation/data/views.py b/gn3/auth/authorisation/data/views.py index 1343f47..1b453a3 100644 --- a/gn3/auth/authorisation/data/views.py +++ b/gn3/auth/authorisation/data/views.py @@ -130,7 +130,7 @@ def migrate_user_group(conn: db.DbConnection, user: User) -> Group: group = user_group(conn, user).maybe(# type: ignore[misc] False, lambda grp: grp) # type: ignore[arg-type] if not bool(group): - group = Group(uuid.UUID(), f"{user.name}'s Group", { + group = Group(uuid.uuid4(), f"{user.name}'s Group", { "created": datetime.datetime.now().isoformat(), "notes": "Imported from redis" }) @@ -224,8 +224,8 @@ def migrate_user_data(): try: user_id = uuid.UUID(request.form.get("user_id", "")) email = validate_email(request.form.get("email", "")) - username = validate_username( - request.form.get("username", "")) + fullname = validate_username( + request.form.get("fullname", "")) password = validate_password( request.form.get("password", ""), request.form.get("confirm_password", "")) @@ -234,7 +234,7 @@ def migrate_user_data(): redis.Redis(decode_responses=True) as rconn, gn3db.database_connection() as gn3conn): user = migrate_user( - authconn, user_id, email["email"], username, + authconn, user_id, email["email"], fullname, password) group = migrate_user_group(authconn, user) user_resource_data = migrate_data( |