Пример #1
0
def delete(short_name):
    app, n_tasks, n_task_runs, overall_progress, last_activity = app_by_shortname(short_name)
    try:
        title = app_title(app, "Delete")
        require.app.read(app)
        require.app.delete(app)
        if request.method == 'GET':
            return render_template('/applications/delete.html',
                                   title=title,
                                   app=app,
                                   n_tasks=n_tasks,
                                   overall_progress=overall_progress,
                                   last_activity=last_activity)
        # Clean cache
        cached_apps.delete_app(app.short_name)
        cached_apps.clean(app.id)
        app = App.query.get(app.id)
        db.session.delete(app)
        db.session.commit()
        flash(gettext('Application deleted!'), 'success')
        return redirect(url_for('account.profile'))
    except HTTPException:
        if app.hidden:
            raise abort(403)
        else:
            raise
Пример #2
0
def delete(short_name):
    app, n_tasks, n_task_runs, overall_progress, last_activity = app_by_shortname(
        short_name)
    try:
        title = app_title(app, "Delete")
        require.app.read(app)
        require.app.delete(app)
        if request.method == 'GET':
            return render_template('/applications/delete.html',
                                   title=title,
                                   app=app,
                                   n_tasks=n_tasks,
                                   overall_progress=overall_progress,
                                   last_activity=last_activity)
        # Clean cache
        cached_apps.delete_app(app.short_name)
        cached_apps.clean(app.id)
        app = App.query.get(app.id)
        db.session.delete(app)
        db.session.commit()
        flash(gettext('Application deleted!'), 'success')
        return redirect(url_for('account.profile'))
    except HTTPException:  # pragma: no cover
        if app.hidden:
            raise abort(403)
        else:
            raise
Пример #3
0
def delete(short_name):
    app = app_by_shortname(short_name)
    title = app_title(app, "Delete")
    if not require.app.delete(app):
        abort(403)
    if request.method == 'GET':
        return render_template('/applications/delete.html',
                               title=title,
                               app=app)
    # Clean cache
    cached_apps.clean(app.id)
    db.session.delete(app)
    db.session.commit()
    flash(lazy_gettext('Application deleted!'), 'success')
    return redirect(url_for('account.profile'))
Пример #4
0
def delete(short_name):
    app = app_by_shortname(short_name)
    title = app_title(app, "Delete")
    if not require.app.delete(app):
        abort(403)
    if request.method == 'GET':
        return render_template('/applications/delete.html',
                               title=title,
                               app=app)
    # Clean cache
    cached_apps.clean(app.id)
    db.session.delete(app)
    db.session.commit()
    flash(gettext('Application deleted!'), 'success')
    return redirect(url_for('account.profile'))
Пример #5
0
def delete(short_name):
    app = app_by_shortname(short_name)
    try:
        title = app_title(app, "Delete")
        require.app.read(app)
        require.app.delete(app)
        if request.method == 'GET':
            return render_template('/applications/delete.html',
                                   title=title,
                                   app=app)
        # Clean cache
        cached_apps.clean(app.id)
        db.session.delete(app)
        db.session.commit()
        flash(gettext('Application deleted!'), 'success')
        return redirect(url_for('account.profile'))
    except HTTPException:
        if app.hidden:
            raise abort(403)
        else:
            raise