Skip to content

Commit 1bae812

Browse files
committed
dupe profile
1 parent a048bd3 commit 1bae812

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

scripts/debug/migrate_dupe_profile.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
old_username='x'
2+
new_username='y'
3+
from dashboard.management.commands import cleanup_dupe_profiles
4+
from dashboard.models import Profile
5+
6+
old_profile = Profile.objects.get(handle__iexact=old_username)
7+
new_profile = Profile.objects.get(handle__iexact=new_username)
8+
9+
new_profile.user = old_profile.user
10+
old_profile.user = None
11+
old_profile.save()
12+
new_profile.save()
13+
14+
cleanup_dupe_profiles.combine_profiles(old_profile, new_profile)

0 commit comments

Comments
 (0)