예제 #1
0
 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
예제 #2
0
파일: views.py 프로젝트: rajur7/Plinth
    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)
예제 #3
0
    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)
예제 #4
0
    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)
예제 #5
0
    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)
예제 #6
0
    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)
예제 #7
0
    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)
예제 #8
0
파일: views.py 프로젝트: rajur7/Plinth
    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()))
예제 #9
0
    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()))
예제 #10
0
 def get_success_url(self):
     """Return next firstboot step."""
     return reverse_lazy(first_boot.next_step())
예제 #11
0
def first_boot_skip(request):
    """Skip the first boot step."""
    first_boot.mark_step_done('pagekite_firstboot')
    return HttpResponseRedirect(reverse(first_boot.next_step()))
예제 #12
0
파일: views.py 프로젝트: rajur7/Plinth
def first_boot_skip(request):
    """Skip the first boot step."""
    first_boot.mark_step_done('pagekite_firstboot')
    return HttpResponseRedirect(reverse(first_boot.next_step()))
예제 #13
0
 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()))
예제 #14
0
 def get_success_url(self):
     """Return the next wizard step after this one."""
     return reverse_lazy(first_boot.next_step())
예제 #15
0
    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())
예제 #16
0
파일: views.py 프로젝트: alirizwi/Plinth
 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())
예제 #17
0
파일: views.py 프로젝트: fonfon/Plinth
 def get_success_url(self):
     """Return the next first boot step after valid form submission."""
     return reverse(first_boot.next_step())
예제 #18
0
 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()))
예제 #19
0
 def get_success_url(self):
     """Return the next first boot step after valid form submission."""
     return reverse(first_boot.next_step())
예제 #20
0
 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()))