Increase GET group member list limit

This commit is contained in:
Tanner Collin 2021-11-11 00:17:44 +00:00
parent 4ab5ead4eb
commit b8dc5467d8
2 changed files with 6 additions and 6 deletions

View File

@ -48,8 +48,8 @@ def discourse_api_get(url, params={}):
'Api-Username': secrets.DISCOURSE_API_USER, 'Api-Username': secrets.DISCOURSE_API_USER,
} }
response = requests.get(url, headers=headers, params=params, timeout=10) response = requests.get(url, headers=headers, params=params, timeout=10)
response.raise_for_status()
logger.debug('Response: %s %s', response.status_code, response.text) logger.debug('Response: %s %s', response.status_code, response.text)
response.raise_for_status()
return response return response
def discourse_api_put(url, data={}): def discourse_api_put(url, data={}):
@ -58,8 +58,8 @@ def discourse_api_put(url, data={}):
'Api-Username': secrets.DISCOURSE_API_USER, 'Api-Username': secrets.DISCOURSE_API_USER,
} }
response = requests.put(url, headers=headers, data=data, timeout=10) response = requests.put(url, headers=headers, data=data, timeout=10)
response.raise_for_status()
logger.debug('Response: %s %s', response.status_code, response.text) logger.debug('Response: %s %s', response.status_code, response.text)
response.raise_for_status()
return response return response
def discourse_api_post(url, data={}): def discourse_api_post(url, data={}):
@ -68,8 +68,8 @@ def discourse_api_post(url, data={}):
'Api-Username': secrets.DISCOURSE_API_USER, 'Api-Username': secrets.DISCOURSE_API_USER,
} }
response = requests.post(url, headers=headers, data=data, timeout=10) response = requests.post(url, headers=headers, data=data, timeout=10)
response.raise_for_status()
logger.debug('Response: %s %s', response.status_code, response.text) logger.debug('Response: %s %s', response.status_code, response.text)
response.raise_for_status()
return response return response
def discourse_api_delete(url, data={}): def discourse_api_delete(url, data={}):
@ -78,8 +78,8 @@ def discourse_api_delete(url, data={}):
'Api-Username': secrets.DISCOURSE_API_USER, 'Api-Username': secrets.DISCOURSE_API_USER,
} }
response = requests.delete(url, headers=headers, data=data, timeout=10) response = requests.delete(url, headers=headers, data=data, timeout=10)
response.raise_for_status()
logger.debug('Response: %s %s', response.status_code, response.text) logger.debug('Response: %s %s', response.status_code, response.text)
response.raise_for_status()
return response return response
def discourse_rails_script(script): def discourse_rails_script(script):
@ -257,7 +257,7 @@ def add_discourse_group_members(group_name, usernames):
logger.info('Filtering out usernames that are already group members...') logger.info('Filtering out usernames that are already group members...')
url = 'https://forum.protospace.ca/groups/{}/members.json'.format(group_name) url = 'https://forum.protospace.ca/groups/{}/members.json?limit=1000'.format(group_name)
response = discourse_api_get(url) response = discourse_api_get(url)
response = response.json() response = response.json()

View File

@ -45,7 +45,7 @@ LOG_DICT = {
}, },
}, },
'root': { 'root': {
'level': 'INFO', 'level': 'DEBUG',
'handlers': ['wsgi'] 'handlers': ['wsgi']
} }
} }