Changed wording

This commit is contained in:
redfast00 2018-09-24 23:07:16 +02:00
parent f4c6988a47
commit 8d10988004
No known key found for this signature in database
GPG key ID: 5946E0E34FD0553C

View file

@ -99,9 +99,11 @@ def revoke(admin_username):
'''Slash-command to revoke a user'''
tokens = request.values.get('text').strip().split()
to_revoke = tokens[0]
user = models.User.query.filter_by(username=to_revoke, admin=False).first()
user = models.User.query.filter_by(username=to_revoke).first()
if not user:
return mattermost_response("Could not find '{}'".format(to_revoke))
if user.admin:
return mattermost_response("Can't revoke admin user")
user.authorized = False
db.session.add(user)
db.session.commit()