Skip to content

Commit

Permalink
sanitize rawrgister username before committing
Browse files Browse the repository at this point in the history
  • Loading branch information
aottr committed Apr 7, 2024
1 parent 024b8ae commit 798d844
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion fbl_integration/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import requests
from django.conf import settings
from core.utils.general import sainitize_username
from .models import FblAccount

def fbl_auth_request_code(badge_number: int, dob: str) -> bool:
Expand Down Expand Up @@ -44,7 +45,8 @@ def get_or_create_account(account_info: dict[str, str]) -> FblAccount:
return user

# Create new user with (generic) username
user = FblAccount.create_user(account_info["username"])
clean_username = sainitize_username(account_info["username"])
user = FblAccount.create_user(clean_username)
return FblAccount.objects.create(
user=user,
badge_number=account_info["badge"],
Expand Down
2 changes: 1 addition & 1 deletion paw/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django import get_version

PAW_VERSION = (0, 5, 9, "final", 0)
FBL_ITERATION = 4
FBL_ITERATION = 5

__version__ = f"{get_version(PAW_VERSION)}-fbl{FBL_ITERATION}"

0 comments on commit 798d844

Please sign in to comment.