mirror of https://gitlab.com/litecord/litecord.git
config: add REGISTRATIONS config check in register bp
This commit is contained in:
parent
2f972fc735
commit
109a56db4c
|
|
@ -31,6 +31,10 @@ def make_token(user_id, user_pwd_hash) -> str:
|
|||
@bp.route('/register', methods=['POST'])
|
||||
async def register():
|
||||
"""Register a single user."""
|
||||
enabled = app.config.get('REGISTRATIONS')
|
||||
if not enabled:
|
||||
return 'Registrations disabled', 405
|
||||
|
||||
j = await request.get_json()
|
||||
email, password, username = j['email'], j['password'], j['username']
|
||||
|
||||
|
|
|
|||
|
|
@ -97,4 +97,5 @@ async def payment_job(app):
|
|||
except Exception:
|
||||
log.exception('error while processing user payments')
|
||||
|
||||
log.debug('rescheduling..')
|
||||
await _resched(app)
|
||||
|
|
|
|||
Loading…
Reference in New Issue