fix remove food, efit food. assed playwright tests

This commit is contained in:
2025-10-03 13:46:38 -07:00
parent 661dbdf0af
commit f931edf8dd
486 changed files with 148847 additions and 88 deletions

12
app/utils.py Normal file
View File

@@ -0,0 +1,12 @@
import re
def slugify(s):
"""
Slugifies a string, converting spaces and non-alphanumeric characters to hyphens.
"""
s = s.lower()
s = re.sub(r'[^a-z0-9\s-]', '', s) # Remove all non-alphanumeric characters except spaces and hyphens
s = re.sub(r'[-\s]+', '-', s) # Replace spaces and hyphens with a single hyphen
s = s.strip('-') # Remove leading/trailing hyphens
return s