keywrods status fixes
This commit is contained in:
22
backend/fix_cluster_status.py
Normal file
22
backend/fix_cluster_status.py
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python
|
||||
"""Fix remaining cluster with old status"""
|
||||
import os
|
||||
import django
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'igny8_core.settings')
|
||||
django.setup()
|
||||
|
||||
from igny8_core.business.planning.models import Clusters
|
||||
|
||||
cluster = Clusters.objects.filter(status='active').first()
|
||||
if cluster:
|
||||
print(f"Found cluster: ID={cluster.id}, name={cluster.name}, status={cluster.status}")
|
||||
print(f"Ideas count: {cluster.ideas.count()}")
|
||||
if cluster.ideas.exists():
|
||||
cluster.status = 'mapped'
|
||||
else:
|
||||
cluster.status = 'new'
|
||||
cluster.save()
|
||||
print(f"Updated to: {cluster.status}")
|
||||
else:
|
||||
print("No clusters with 'active' status found")
|
||||
Reference in New Issue
Block a user