def get_context_data(self, *args, **kwargs): context = super().get_context_data(*args, **kwargs) context['is_busy'] = (_is_updating() or package.is_package_manager_busy()) context['next_step'] = first_boot.next_step() context['refresh_page_sec'] = 3 if context['is_busy'] else None return context
def get(self, request, *args, **kwargs): """Skip if this first boot step if it is not relavent.""" if not cfg.danube_edition: first_boot.mark_step_done('pagekite_firstboot') return HttpResponseRedirect(reverse(first_boot.next_step())) return super().get(request, *args, **kwargs)
def dispatch(self, request, *args, **kwargs): """Show backports configuration form only if it can be activated.""" if upgrades.is_backports_enabled(): # Backports is already enabled. Record this preference and # skip first boot step. upgrades.set_backports_requested(True) first_boot.mark_step_done('backports_wizard') return HttpResponseRedirect(reverse_lazy(first_boot.next_step())) if not upgrades.can_activate_backports(): # Skip first boot step. upgrades.set_backports_requested(False) first_boot.mark_step_done('backports_wizard') return HttpResponseRedirect(reverse_lazy(first_boot.next_step())) return super().dispatch(request, *args, *kwargs)
def dispatch(self, request, *args, **kwargs): """Check if there is no possibility to create a new admin account.""" if request.method == 'POST' and 'skip' in request.POST: first_boot.mark_step_done('users_firstboot') return HttpResponseRedirect(reverse(first_boot.next_step())) return super().dispatch(request, *args, **kwargs)
def get(self, request, *args, **kwargs): """Skip if this first boot step if it is not relavent.""" if not cfg.danube_edition: first_boot.mark_step_done('pagekite_firstboot') return HttpResponseRedirect(reverse(first_boot.next_step())) return super().get(request, *args, **kwargs)
def dispatch(self, request, *args, **kwargs): """Don't show wizard step if FreedomBox is not behind a router.""" network_topology = networks.get_network_topology_type() if network_topology != 'to_router': first_boot.mark_step_done('router_setup_wizard') return HttpResponseRedirect(reverse_lazy(first_boot.next_step())) return super().dispatch(request, *args, *kwargs)
def dispatch(self, request, *args, **kwargs): """Don't show wizard step if FreedomBox is not behind a router.""" network_topology = kvstore.get_default( networks.NETWORK_TOPOLOGY_TYPE_KEY, 'to_router') if network_topology != 'to_router': first_boot.mark_step_done('router_setup_wizard') return HttpResponseRedirect(reverse_lazy(first_boot.next_step())) return super().dispatch(request, *args, *kwargs)
def form_valid(self, form): """Act on valid form submission.""" try: form.register_domain() except DomainRegistrationError as error: messages.error(self.request, error) return self.form_invalid(form) form.setup_pagekite() first_boot.mark_step_done('pagekite_firstboot') message = _('Pagekite setup finished. The HTTP and HTTPS services ' 'are activated now.') messages.success(self.request, message) return HttpResponseRedirect(reverse(first_boot.next_step()))
def form_valid(self, form): """Act on valid form submission.""" try: form.register_domain() except DomainRegistrationError as error: messages.error(self.request, error) return self.form_invalid(form) form.setup_pagekite() first_boot.mark_step_done('pagekite_firstboot') message = _('Pagekite setup finished. The HTTP and HTTPS services ' 'are activated now.') messages.success(self.request, message) return HttpResponseRedirect(reverse(first_boot.next_step()))
def get_success_url(self): """Return next firstboot step.""" return reverse_lazy(first_boot.next_step())
def first_boot_skip(request): """Skip the first boot step.""" first_boot.mark_step_done('pagekite_firstboot') return HttpResponseRedirect(reverse(first_boot.next_step()))
def first_boot_skip(request): """Skip the first boot step.""" first_boot.mark_step_done('pagekite_firstboot') return HttpResponseRedirect(reverse(first_boot.next_step()))
def form_valid(self, form): """If form is valid, mark this step as done and move to next step.""" first_boot.mark_step_done('firstboot_welcome') return http.HttpResponseRedirect(reverse(first_boot.next_step()))
def get_success_url(self): """Return the next wizard step after this one.""" return reverse_lazy(first_boot.next_step())
def get_success_url(self): """Return next firstboot step.""" if self.update: return reverse_lazy('upgrades:update-firstboot-progress') return reverse_lazy(first_boot.next_step())
def get_redirect_url(self, *args, **kwargs): actions.superuser_run('auth-pubtkt', ['create-key-pair']) first_boot.mark_step_done('sso_firstboot') return reverse(first_boot.next_step())
def get_success_url(self): """Return the next first boot step after valid form submission.""" return reverse(first_boot.next_step())
def post(self, request, *args, **kwargs): """On POST, mark this step as done and move to next step.""" first_boot.mark_step_done('firstboot_welcome') return http.HttpResponseRedirect(reverse(first_boot.next_step()))
def get_success_url(self): """Return the next first boot step after valid form submission.""" return reverse(first_boot.next_step())
def form_valid(self, form): """If form is valid, mark this step as done and move to next step.""" self.request.session['firstboot_secret_provided'] = True first_boot.mark_step_done('firstboot_welcome') return http.HttpResponseRedirect(reverse(first_boot.next_step()))