示例#1
0
 def delete_user(username):
     user_data = Database.find_one(collection, {'username': username})
     if user_data is None:
         raise UserErrors.UserNotExistsError("Your User doesn't Exist")
     Database.remove(collection=collection, query={'username': username})
     Database.updateMany(collection=group_table,
                         query={},
                         data={'$pull': {
                             'users': username
                         }})
     return True
示例#2
0
 def delete_node(mac):
     data = Database.find_one(collection=collection, query={'mac': mac})
     if data is None:
         raise NodeErrors.NodeNotExistsError(
             'System Does not Exists with that name')
     Database.remove(collection=collection, query={'mac': mac})
     Database.updateMany(collection=group_table,
                         query={},
                         data={'$pull': {
                             'nodes': mac
                         }})
     return True