Skip to content

Commit

Permalink
case insensitiveize the usernames
Browse files Browse the repository at this point in the history
  • Loading branch information
catgirlinspace committed Jul 15, 2023
1 parent 8ac73d3 commit 35989f6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# Create your views here.

def profile(request, username: str):
user = get_object_or_404(User, username=username)
user = get_object_or_404(User, username__iexact=username)
latest_battles = user.battles.with_prefetch().order_by('-played_time') \
.select_related('vs_stage__name')[:12]
splashtag = latest_battles[0].splashtag if latest_battles else None
Expand Down Expand Up @@ -67,7 +67,7 @@ def profile(request, username: str):


def profile_opengraph(request, username: str):
user = get_object_or_404(User, username=username)
user = get_object_or_404(User, username__iexact=username)
latest_battles = user.battles.with_prefetch().order_by('-played_time') \
.select_related('vs_stage__name')[:12]
splashtag = latest_battles[0].splashtag if latest_battles else None
Expand Down Expand Up @@ -100,7 +100,7 @@ def profile_opengraph(request, username: str):


def profile_battle_list(request, username: str):
user = get_object_or_404(User, username=username)
user = get_object_or_404(User, username__iexact=username)
battles = user.battles.with_prefetch().order_by('-played_time') \
.select_related('vs_stage__name')

Expand Down

0 comments on commit 35989f6

Please sign in to comment.