

def delete(self):
    content_url = url_factory.load_basic_parameters(self, prefix='/users')
    if (content_url['profile'] != self.current_user['username']):
        if (not self.authenticate(superuser=True)):
            return
    elif (not self.authenticate(author=True)):
        return
    user = self.models.users.get(username=content_url['profile'])[0]
    if (not user):
        raise tornado.web.HTTPError(404)
    user.delete()
    shutil.rmtree(os.path.join(self.application.settings['private_path'], content_url['profile']))
    shutil.rmtree(os.path.join(self.application.settings['resource_path'], content_url['profile']))
    self.set_status(204)

dataset/ETHPy150Open mimecuvalo/helloworld/controllers/users.py UsersHandler.delete/original