Add script to sync member statuses in DB
This commit is contained in:
parent
1924ea9399
commit
b272469625
17
apiserver/sync_member_statuses.py
Normal file
17
apiserver/sync_member_statuses.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
import django, sys, os
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'apiserver.settings'
|
||||
django.setup()
|
||||
|
||||
from apiserver.api import models
|
||||
|
||||
members = models.Member.objects.all()
|
||||
count = 0
|
||||
|
||||
for m in members:
|
||||
if m.paused_date and m.status in ['Prepaid', 'Current', 'Due', 'Overdue']:
|
||||
print('Setting', m.first_name, m.last_name, 'to Former Member.')
|
||||
m.status = 'Former Member'
|
||||
count += 1
|
||||
m.save()
|
||||
|
||||
print('Processed', count)
|
Loading…
Reference in New Issue
Block a user