Example #1
0
 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
Example #2
0
 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
Example #3
0
 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