From baef6481ac5eb6ab8cd8196637894b794e44283b Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 10 Mar 2023 04:23:58 +0300 Subject: auth: data-migration: Fix minor bugs --- gn3/auth/authorisation/data/views.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gn3/auth/authorisation/data') 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( -- cgit v1.2.3