• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

iplweb / bpp / 18634744198

19 Oct 2025 07:00PM UTC coverage: 31.618% (-29.9%) from 61.514%
18634744198

push

github

mpasternak
Merge branch 'release/v202510.1270'

657 of 9430 branches covered (6.97%)

Branch coverage included in aggregate %.

229 of 523 new or added lines in 42 files covered. (43.79%)

11303 existing lines in 316 files now uncovered.

14765 of 39346 relevant lines covered (37.53%)

0.38 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

45.83
src/bpp/forms/__init__.py
1
from crispy_forms.helper import FormHelper
1✔
2
from crispy_forms.layout import Hidden
1✔
3
from crispy_forms.utils import TEMPLATE_PACK
1✔
4
from crispy_forms_foundation.layout import ButtonHolder, Fieldset, Layout, Submit
1✔
5
from django.contrib.auth import REDIRECT_FIELD_NAME
1✔
6
from django.contrib.auth.forms import AuthenticationForm
1✔
7
from django.template.loader import render_to_string
1✔
8

9

10
class SecureNextLink(Hidden):
1✔
11
    def render(self, form, context, template_pack=TEMPLATE_PACK, **kwargs):
1✔
12
        """
13
        Renders an `<input />` if container is used as a Layout object.
14
        Input button value can be a variable in context.
15
        """
16
        # django-crispy-forms traktuje wartość jako... templatkę, więc w ten sposób moglibyśmy
17
        # umożliwić zdalnemu użytkownikowi uruchamianie kodu na serwerze:
18

19
        # self.value = Template(str(self.value)).render(context)
20

UNCOV
21
        template = self.get_template_name(template_pack)
×
UNCOV
22
        context.update({"input": self})
×
UNCOV
23
        return render_to_string(template, context.flatten())
×
24

25

26
class MyAuthenticationForm(AuthenticationForm):
1✔
27
    def __init__(self, request=None, *args, **kw):
1✔
UNCOV
28
        self.helper = FormHelper()
×
UNCOV
29
        self.helper.form_class = "custom"
×
UNCOV
30
        self.helper.form_action = "."
×
31

32
        # Get the next parameter from the request
UNCOV
33
        next_url = ""
×
UNCOV
34
        if request:
×
UNCOV
35
            next_url = request.GET.get(REDIRECT_FIELD_NAME, "")
×
36

UNCOV
37
        self.helper.layout = Layout(
×
38
            Fieldset(
39
                "Zaloguj się!",
40
                "username",
41
                "password",
42
                SecureNextLink(REDIRECT_FIELD_NAME, next_url),
43
            ),
44
            ButtonHolder(
45
                Submit(
46
                    "submit",
47
                    "Zaloguj się",
48
                    css_id="id_submit",
49
                    css_class="submit button",
50
                ),
51
            ),
52
        )
UNCOV
53
        AuthenticationForm.__init__(self, request, *args, **kw)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc