avoid the extra SELECT

This commit is contained in:
Brian Rosner 2012-09-15 17:47:59 -06:00
parent bb2ffd2df0
commit aad54984c5

View file

@ -48,6 +48,5 @@ class TeamInvitationForm(forms.Form):
Membership.objects.create(team=self.team, user=self.user, state="invited") Membership.objects.create(team=self.team, user=self.user, state="invited")
elif self.state == "applied": elif self.state == "applied":
# if they applied we shortcut invitation process # if they applied we shortcut invitation process
membership = Membership.objects.get(team=self.team, user=self.user) membership = Membership.objects.filter(team=self.team, user=self.user)
membership.state = "member" membership.update(state="member")
membership.save()