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

iplweb / bpp / 930a3884-329c-4ed2-be02-1b163c005b74

21 Aug 2025 08:55PM UTC coverage: 45.719% (-0.6%) from 46.337%
930a3884-329c-4ed2-be02-1b163c005b74

push

circleci

mpasternak
Merge branch 'release/v202508.1200'

4 of 9 new or added lines in 3 files covered. (44.44%)

927 existing lines in 48 files now uncovered.

17450 of 38168 relevant lines covered (45.72%)

1.18 hits per line

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

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

7
from django.contrib.auth import REDIRECT_FIELD_NAME
3✔
8
from django.contrib.auth.forms import AuthenticationForm
3✔
9

10

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

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

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

26

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

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

UNCOV
38
        self.helper.layout = Layout(
1✔
39
            Fieldset(
40
                "Zaloguj się!",
41
                "username",
42
                "password",
43
                SecureNextLink(REDIRECT_FIELD_NAME, next_url),
44
            ),
45
            ButtonHolder(
46
                Submit(
47
                    "submit",
48
                    "Zaloguj się",
49
                    css_id="id_submit",
50
                    css_class="submit button",
51
                ),
52
            ),
53
        )
UNCOV
54
        AuthenticationForm.__init__(self, request, *args, **kw)
1✔
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