mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-11-09 13:32:19 -05:00
* add default assets for user profile * add recipe avatar * change user_id to UUID * add profile image upload * setup image cache keys * cleanup tests and add image tests * purge user data on delete * new user repository tests * add user_id validator for int -> UUID conversion * delete depreciated route * force set content type * refactor tests to use temp directory * validate parent exists before createing * set user_id to correct type * update instruction id * reset primary key on migration
10 lines
255 B
Python
10 lines
255 B
Python
import random
|
|
import string
|
|
|
|
|
|
def new_cache_key(length=4) -> str:
|
|
"""returns a 4 character string to be used as a cache key for frontend data"""
|
|
options = string.ascii_letters + string.digits
|
|
|
|
return "".join(random.choices(options, k=length))
|