Verified Commit fa1d3465 authored by Štěpán Henek's avatar Štěpán Henek 🌩

disable to connect to nuci and remove last nuci call from config app

parent 11f6f942
......@@ -27,14 +27,9 @@ import bottle
from foris.common import require_contract_valid, login
from foris.utils.translators import gettext_dummy as gettext, _
from foris.caches import lazy_cache
from foris.config_handlers import (
backups, collect, dns, misc, notifications, wan, lan, updater, wifi
)
from foris.nuci import client
from foris.nuci.client import filters
from foris.nuci.helpers import get_wizard_progress
from foris.nuci.preprocessors import preproc_disabled_to_agreed
from foris.utils import login_required, messages, is_safe_redirect, contract_valid
from foris.middleware.bottle_csrf import CSRFPlugin
from foris.utils.routing import reverse
......@@ -759,9 +754,7 @@ def top_index():
response.status = 403
else:
next = bottle.request.GET.get("next", None)
allowed_step_max, wizard_finished = get_wizard_progress(session)
if allowed_step_max == 1:
if not current_state.password_set: # auto login if no password is set
if session.is_anonymous:
session.recreate()
session["user_authenticated"] = True
......
......@@ -65,4 +65,7 @@ class BackendData(object):
# update updater running indicator
current_state.set_updater_is_running(data["updater_running"])
# update whether password is set
current_state.update_password_set(data["password_ready"])
return self.app(environ, start_response)
......@@ -156,7 +156,8 @@ class StaticNetconfConnection(object):
# open persistent connection to Nuci
netconf = StaticNetconfConnection()
#netconf = StaticNetconfConnection()
netconf = None # disable to connect
def get(filter=None):
......
......@@ -76,5 +76,9 @@ class ForisState(object):
logger.debug("setting updater_is_running=%s" % running)
self.updater_is_running = running
def update_password_set(self, password_set):
logger.debug("setting password_set=%s" % password_set)
self.password_set = password_set
current_state = ForisState()
......@@ -18,7 +18,6 @@
import bottle
from foris.caches import lazy_cache
from foris.langs import iso2to3, translation_names
from foris.middleware.bottle_csrf import get_csrf_token
from foris.state import current_state
......@@ -67,6 +66,7 @@ def clickjacking_protection():
def clear_lazy_cache():
from foris.caches import lazy_cache
lazy_cache.clear()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment