def save(self): to_user = User.objects.get(username=self.cleaned_data["to_user"]) blocking = Blocking( from_user=self.user, to_user=to_user, ) blocking.save() return blocking
def save(self): to_user = get_user_model().objects.get(username=self.cleaned_data["to_user"]) blocking = Blocking( from_user=self.user, to_user=to_user, ) blocking.save() return blocking
def save(self): """ Overrides save so that we can use our custom clean method. """ to_user = User.objects.get(username=self.cleaned_data["to_user"]) blocking = Blocking( from_user=self.user, to_user=to_user, ) blocking.save() return blocking