Commit 7b02c567 authored by Sergios Aftsidis's avatar Sergios Aftsidis

Fix user accounts assigned with wrong peers

parent 085dec60
......@@ -88,7 +88,16 @@ def activate(request, activation_key):
try:
user = User.objects.get(pk=request_data['user'])
up = user.get_profile()
for peer in request_data['peers']:
# use getlist to get the list of peers (might be multiple)
profile_peers = request.POST.getlist('peers')
# remove already assigned peers, as these are selected by
# the user, no admin has yet verified those. They will be
# replaced by the admin's selection.
up.peers.clear()
for peer in profile_peers:
up.peers.add(Peer.objects.get(pk=peer))
up.save()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment