Visual formatting for reconcile_subscribers
This commit is contained in:
@@ -18,13 +18,12 @@ def reconcile_subscribers():
|
||||
|
||||
users_coll = current_app.data.driver.db['users']
|
||||
unsubscribed_users = []
|
||||
for user in users_coll.find():
|
||||
for user in users_coll.find({'roles': 'subscriber'}):
|
||||
print('Processing %s' % user['email'])
|
||||
if 'roles' in user and 'subscriber' in user['roles']:
|
||||
print('Checking subscription')
|
||||
print(' Checking subscription')
|
||||
user_store = fetch_user(user['email'])
|
||||
if user_store['cloud_access'] == 0:
|
||||
print('Removing subscriber role')
|
||||
print(' Removing subscriber role')
|
||||
users_coll.update(
|
||||
{'_id': user['_id']},
|
||||
{'$pull': {'roles': 'subscriber'}})
|
||||
|
Reference in New Issue
Block a user