fix: cant add user to team if already in other team

This commit is contained in:
Élie Bouttier 2014-09-01 18:53:45 -07:00
parent 5c0e20a380
commit 1fdef35b88

View file

@ -181,7 +181,7 @@ def user_add_team(request, user):
else: else:
# We do not use user.teams because we want to be able to add an # We do not use user.teams because we want to be able to add an
# user to a team even if he is already a member through a group # user to a team even if he is already a member through a group
if Team.objects.filter(users=user).exists(): if Team.objects.filter(name=team,users=user).exists():
messages.info(request, 'User already in team.') messages.info(request, 'User already in team.')
else: else:
team.users.add(user) team.users.add(user)