Esempio n. 1
0
def get_themes(request, template_name="theme_editor/get_themes.html"):
    if not request.user.profile.is_superuser:
        raise Http403

    if request.is_ajax():
        tracker = UpdateTracker.get_or_create_instance()
        return HttpResponse(tracker.is_updating)

    if request.method == 'POST':
        process = SubProcessManager.set_process(["python", "manage.py", "install_theme", "--all"])
        return render_to_response(template_name, context_instance=RequestContext(request))

    raise Http404
Esempio n. 2
0
def get_themes(request, template_name="theme_editor/get_themes.html"):
    if not request.user.profile.is_superuser:
        raise Http403

    if request.is_ajax():
        tracker = UpdateTracker.get_or_create_instance()
        return HttpResponse(tracker.is_updating)

    if request.method == 'POST':
        process = SubProcessManager.set_process(["python", "manage.py", "install_theme", "--all"])
        return render_to_response(template_name, context_instance=RequestContext(request))

    raise Http404
Esempio n. 3
0
def update_tendenci(request, template_name="base/update.html"):
    if request.method == "POST":
        process = SubProcessManager.set_process(["python", "manage.py", "update_tendenci"])
        return redirect('update_tendenci.process')

    pypi = xmlrpclib.ServerProxy('http://pypi.python.org/pypi')
    latest_version = pypi.package_releases('tendenci')[0]

    update_available = False
    if latest_version != version:
        update_available = True

    return render_to_response(template_name, {
        'latest_version': latest_version,
        'update_available': update_available,
    }, context_instance=RequestContext(request))
Esempio n. 4
0
def update_tendenci(request, template_name="base/update.html"):
    if request.method == "POST":
        process = SubProcessManager.set_process(["python", "manage.py", "update_tendenci",
                                                 "--user=%s" % request.user.id])
        return redirect('update_tendenci.confirmation')

    pypi = xmlrpclib.ServerProxy('http://pypi.python.org/pypi')
    latest_version = pypi.package_releases('tendenci')[0]

    update_available = False
    if latest_version != version:
        update_available = True

    return render_to_response(template_name, {
        'latest_version': latest_version,
        'update_available': update_available,
    }, context_instance=RequestContext(request))