Skip to content
This repository was archived by the owner on Aug 31, 2024. It is now read-only.

Start implementing filters for usernames with eversiege. #14

Open
wants to merge 1 commit into
base: api-v2
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions arcos_backend/_utils.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import hashlib

from profanity import profanity

MAX_USERNAME_LEN = 25


def validate_username(username: str) -> bool:
if len(username) > MAX_USERNAME_LEN or len(username) < 1:
if len(username) > MAX_USERNAME_LEN or len(username) < 1 or profanity.contains_profanity(username):
return False
return True

Expand Down