def really_delete(self, projects=None, reason=None, disable_users=False, **kw): if not projects: flash(u'No projects specified', 'warning') redirect('.') projects = self.parse_projects(projects) task_params = [ u'{}/{}'.format(p.neighborhood.url_prefix.strip('/'), p.shortname) for (_, p, _) in projects if p ] if not task_params: flash(u'Unable to parse at least one project from your input', 'warning') redirect('.') task_params = u' '.join(task_params) if reason: task_params = u'-r {} {}'.format(pipes.quote(reason), task_params) if disable_users: task_params = u'--disable-users {}'.format(task_params) DeleteProjects.post(task_params) flash(u'Delete scheduled', 'ok') redirect('.')
def really_delete(self, projects=None, reason=None, disable_users=False, **kw): if not projects: flash(u'No projects specified', 'warning') redirect('.') projects = self.parse_projects(projects) task_params = [p.url().strip('/') for (_, p, _) in projects if p] if not task_params: flash(u'Unable to parse at least one project from your input', 'warning') redirect('.') task_params = u' '.join(task_params) if reason: task_params = u'-r {} {}'.format(pipes.quote(reason), task_params) if disable_users: task_params = u'--disable-users {}'.format(task_params) DeleteProjects.post(task_params) flash(u'Delete scheduled', 'ok') redirect('.')