Esempio n. 1
0
def deleteApplicationSite(name, group_name, url_back):
    """
    delete application-site

    delete an existing application-site

    arguments:
        app_list: the id number of the application-site groups

    return: renders the show application-sites page
    """
    appl = APIObject(name, 'application-site')
    appl_to_delete = appl.show()

    if request.method == 'POST':

        appl.delete_from_group('set-application-site-group', group_name)

        if appl.where_used() >= 2:
            api.api_call('publish')
            flash(
                u"The URL belongs to more lists, it is not completely deleted")
            return redirect(url_for(url_back))

        appl.delete_from_group('set-application-site-group', 'APGR_GENERAL')

        appl.delete()

        api.api_call('publish')
        flash(u'URL removed')
        return redirect(url_for(url_back))

    return render_template('delete-application-site.html',
                           group_name=group_name,
                           appl_to_delete=appl_to_delete,
                           url_back=url_back)
Esempio n. 2
0
def deleteApplicationSite(name, group_name, url_back):
    """
    delete application-site

    delete an existing application-site

    arguments:
        app_list: the id number of the application-site groups

    return: renders the show application-sites page
    """
    appl = APIObject(name, 'application-site')
    appl_to_delete = appl.show()

    if request.method == 'POST':

        appl.delete_from_group('set-application-site-group', group_name)

        if appl.where_used() >= 2:
            api.api_call('publish')
            flash(u"La URL pertany a més llistes, no s'elimina totalment")
            return redirect(url_for(url_back))

        appl.delete_from_group('set-application-site-group', 'APGR_GENERAL')

        appl.delete()

        api.api_call('publish')
        flash(u'URL eliminada')
        return redirect(url_for(url_back))

    return render_template(
        'delete-application-site.html',
        group_name=group_name,
        appl_to_delete=appl_to_delete,
        url_back=url_back)