Skip to content

Commit

Permalink
fix(users): recorrect comparing self invited_by_code
Browse files Browse the repository at this point in the history
  • Loading branch information
temirovazat committed Nov 16, 2023
1 parent 53bc76f commit f455058
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/api/v1/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,6 @@ def post(self, request):
{'invited_by_code': 'Неверный реферальный код.'},
status=status.HTTP_403_FORBIDDEN
)
if user.first().invite_code.lower() == invited_by_code.lower():
return Response(
{'invited_by_code': 'Нельзя использовать свой код.'},
status=status.HTTP_403_FORBIDDEN
)
user_data['invited_by_code'] = invited_by_code

user, _ = User.objects.update_or_create(
Expand Down

0 comments on commit f455058

Please sign in to comment.