diff --git a/helios/models.py b/helios/models.py index e560ccb4330ba299235f3c526f40efbe2105a07d..368438e3b92cad3ed31e9829f0e6b52f920085c6 100644 --- a/helios/models.py +++ b/helios/models.py @@ -799,8 +799,8 @@ class VoterFile(models.Model): # create the voter if not existing_voter: if voter['voter_type'] != 'password': - user = User.update_or_create(user_type=voter['voter_type'], user_id=voter['voter_id']) - Voter.register_user_in_election(user, election) + user, _ = User.objects.get_or_create(user_type=voter['voter_type'], user_id=voter['voter_id'], defaults = {'name': voter['voter_id'], 'info': {}, 'token': None}) + Voter.register_user_in_election(user, self.election) else: voter_uuid = str(uuid.uuid4()) new_voter = Voter(uuid=voter_uuid, user = None, voter_login_id = voter['voter_id'],