From 3c7da371d2935b8afb556038a9c5647d4b08de74 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Tue, 2 Oct 2018 07:23:41 +0000 Subject: [PATCH] spelling: privilege --- app/models.py | 18 +++++++++--------- app/templates/admin_manageuser.html | 2 +- app/views.py | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/models.py b/app/models.py index 4869608..2f14190 100644 --- a/app/models.py +++ b/app/models.py @@ -440,7 +440,7 @@ class User(db.Model): def revoke_privilege(self): """ - Revoke all privielges from a user + Revoke all privileges from a user """ user = User.query.filter(User.username == self.username).first() @@ -452,7 +452,7 @@ class User(db.Model): return True except Exception as e: db.session.rollback() - logging.error('Cannot revoke user {0} privielges. DETAIL: {1}'.format(self.username, e)) + logging.error('Cannot revoke user {0} privileges. DETAIL: {1}'.format(self.username, e)) return False return False @@ -603,7 +603,7 @@ class Account(db.Model): db.session.commit() except Exception as e: db.session.rollback() - logging.error('Cannot revoke user privielges on account {0}. DETAIL: {1}'.format(self.name, e)) + logging.error('Cannot revoke user privileges on account {0}. DETAIL: {1}'.format(self.name, e)) try: for uid in added_ids: @@ -616,7 +616,7 @@ class Account(db.Model): def revoke_privileges_by_id(self, user_id): """ - Remove a single user from prigilege list based on user_id + Remove a single user from privilege list based on user_id """ new_uids = [u for u in self.get_user() if u != user_id] users = [] @@ -635,7 +635,7 @@ class Account(db.Model): return True except Exception as e: db.session.rollback() - logging.error('Cannot add user privielges on account {0}. DETAIL: {1}'.format(self.name, e)) + logging.error('Cannot add user privileges on account {0}. DETAIL: {1}'.format(self.name, e)) return False def remove_user(self, user): @@ -648,7 +648,7 @@ class Account(db.Model): return True except Exception as e: db.session.rollback() - logging.error('Cannot revoke user privielges on account {0}. DETAIL: {1}'.format(self.name, e)) + logging.error('Cannot revoke user privileges on account {0}. DETAIL: {1}'.format(self.name, e)) return False @@ -972,7 +972,7 @@ class Domain(db.Model): if 0 != len(domain_users): self.name = domain_reverse_name self.grant_privileges(domain_users) - return {'status': 'ok', 'msg': 'New reverse lookup domain created with granted privilages'} + return {'status': 'ok', 'msg': 'New reverse lookup domain created with granted privileges'} return {'status': 'ok', 'msg': 'New reverse lookup domain created without users'} return {'status': 'ok', 'msg': 'Reverse lookup domain already exists'} @@ -1037,7 +1037,7 @@ class Domain(db.Model): db.session.commit() except Exception as e: db.session.rollback() - logging.error('Cannot revoke user privielges on domain {0}. DETAIL: {1}'.format(self.name, e)) + logging.error('Cannot revoke user privileges on domain {0}. DETAIL: {1}'.format(self.name, e)) try: for uid in added_ids: @@ -1046,7 +1046,7 @@ class Domain(db.Model): db.session.commit() except Exception as e: db.session.rollback() - logging.error('Cannot grant user privielges to domain {0}. DETAIL: {1}'.format(self.name, e)) + logging.error('Cannot grant user privileges to domain {0}. DETAIL: {1}'.format(self.name, e)) def update_from_master(self, domain_name): """ diff --git a/app/templates/admin_manageuser.html b/app/templates/admin_manageuser.html index b9a446c..2c8c3c4 100644 --- a/app/templates/admin_manageuser.html +++ b/app/templates/admin_manageuser.html @@ -104,7 +104,7 @@ var info = "Are you sure you want to revoke all privileges for " + username + ". They will not able to access any domain."; modal.find('.modal-body p').text(info); modal.find('#button_revoke_confirm').click(function() { - var postdata = {'action': 'revoke_user_privielges', 'data': username} + var postdata = {'action': 'revoke_user_privileges', 'data': username} applyChanges(postdata, $SCRIPT_ROOT + '/admin/manageuser'); modal.modal('hide'); }) diff --git a/app/views.py b/app/views.py index 1fc824c..de4eb29 100644 --- a/app/views.py +++ b/app/views.py @@ -700,7 +700,7 @@ def domain_management(domain_name): # username in right column new_user_list = request.form.getlist('domain_multi_user[]') - # grant/revoke user privielges + # grant/revoke user privileges d = Domain(name=domain_name) d.grant_privileges(new_user_list) @@ -1198,13 +1198,13 @@ def admin_manageuser(): else: return make_response(jsonify( { 'status': 'error', 'msg': 'Cannot remove user.' } ), 500) - elif jdata['action'] == 'revoke_user_privielges': + elif jdata['action'] == 'revoke_user_privileges': user = User(username=data) result = user.revoke_privilege() if result: - history = History(msg='Revoke {0} user privielges'.format(data), created_by=current_user.username) + history = History(msg='Revoke {0} user privileges'.format(data), created_by=current_user.username) history.add() - return make_response(jsonify( { 'status': 'ok', 'msg': 'Revoked user privielges.' } ), 200) + return make_response(jsonify( { 'status': 'ok', 'msg': 'Revoked user privileges.' } ), 200) else: return make_response(jsonify( { 'status': 'error', 'msg': 'Cannot revoke user privilege.' } ), 500)