ensure new users get a default collection on signup and any missing users get them too

This commit is contained in:
2026-06-07 13:09:17 +03:00
parent 84dbaa2cd8
commit 7b16ac91ed
2 changed files with 27 additions and 4 deletions

View File

@@ -162,6 +162,13 @@ def clear_api_limits():
for l in limits:
l.delete()
def ensure_default_collection():
from .db import db
from .models import BookmarkCollections
with db.transaction():
for missing_user in BookmarkCollections.get_users_without_default():
BookmarkCollections.create_default(missing_user)
cache = Cache()
def create_app():
@@ -243,6 +250,8 @@ def create_app():
reparse_babycode()
ensure_default_collection()
bind_default_badges(app.config['BADGES_PATH'])
app.config['SESSION_COOKIE_SECURE'] = True