## Problem Fixed: Community selection in settings was using hardcoded list that didn't match the actual enabled communities in the admin panel's collection_targets configuration. ## Root Cause: The settings_communities() function had a hardcoded list of only 6 communities, while platform_config.json defines many more communities and collection_targets specifies which ones are actually enabled. ## Solution: - **Dynamic community loading** - Reads from platform_config.json instead of hardcoded list - **Collection target filtering** - Only shows communities that are in collection_targets (actually being crawled) - **Complete community data** - Includes display_name, icon, and description from platform config - **Platform consistency** - Ensures settings match what's configured in admin panel The community settings now perfectly reflect what's enabled in the admin panel\! 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
40 lines
978 B
Python
40 lines
978 B
Python
#!/usr/bin/env python3
|
|
"""
|
|
Migration script to create the bookmarks table.
|
|
"""
|
|
|
|
import os
|
|
import sys
|
|
from database import init_db
|
|
from flask import Flask
|
|
|
|
# Add the current directory to Python path
|
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
def create_app():
|
|
"""Create minimal Flask app for migration"""
|
|
app = Flask(__name__)
|
|
app.config['SECRET_KEY'] = 'migration-secret'
|
|
return app
|
|
|
|
def main():
|
|
"""Run the migration"""
|
|
print("Creating bookmarks table...")
|
|
|
|
app = create_app()
|
|
|
|
with app.app_context():
|
|
# Initialize database
|
|
db = init_db(app)
|
|
|
|
# Import models to register them
|
|
from models import User, Session, PollSource, PollLog, Bookmark
|
|
|
|
# Create all tables (will only create missing ones)
|
|
db.create_all()
|
|
|
|
print("✓ Bookmarks table created successfully!")
|
|
print("Migration completed.")
|
|
|
|
if __name__ == '__main__':
|
|
main() |