feat: add RBAC migrations, user modules, admin API updates, and utility scripts
This commit is contained in:
29
update_events.py
Normal file
29
update_events.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import os
|
||||
import django
|
||||
import sys
|
||||
import datetime
|
||||
|
||||
# Add the project directory to sys.path
|
||||
sys.path.append('/var/www/myproject/eventify_prod')
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'eventify.settings')
|
||||
django.setup()
|
||||
|
||||
from events.models import Event
|
||||
|
||||
start = datetime.date(2026, 1, 1)
|
||||
end = datetime.date(2026, 12, 31)
|
||||
|
||||
print(f"Checking for events from {start} to {end}...")
|
||||
|
||||
events = Event.objects.filter(start_date=start, end_date=end)
|
||||
count = events.count()
|
||||
|
||||
print(f"Found {count} events matching the criteria.")
|
||||
|
||||
if count > 0:
|
||||
# Update matched events
|
||||
updated_count = events.update(all_year_event=True)
|
||||
print(f"Successfully updated {updated_count} events to be 'All Year'.")
|
||||
else:
|
||||
print("No events found to update.")
|
||||
Reference in New Issue
Block a user