From 1dc5969cbc79b20c5d1cfa84a9b5126ca344d129 Mon Sep 17 00:00:00 2001 From: j Date: Fri, 9 Mar 2018 16:03:52 +0530 Subject: [PATCH] fix rename user --- pandora/user/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pandora/user/utils.py b/pandora/user/utils.py index fe312b3cd..5e07ebb4e 100644 --- a/pandora/user/utils.py +++ b/pandora/user/utils.py @@ -30,12 +30,12 @@ def get_location(ip): return city, country -def rename_user(user, new): +def rename_user(u, new): import itemlist.models import item.models import user.models - old = user.username + old = u.username old_prefix = old + ':' new_prefix = new + ':' @@ -69,7 +69,8 @@ def rename_user(user, new): # update user item find item.models.ItemFind.objects.filter(key='user', value=old).update(value=new) - user.username = new + u.username = new + u.save() def update_groups(model, groups): if isinstance(groups, list):