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

iplweb / bpp / 0cececd7-a2e7-4a75-a26c-21df764ad54e

24 Aug 2025 10:29PM UTC coverage: 41.169% (-2.5%) from 43.704%
0cececd7-a2e7-4a75-a26c-21df764ad54e

push

circleci

mpasternak
Merge branch 'release/v202508.1206'

1 of 1 new or added line in 1 file covered. (100.0%)

2674 existing lines in 124 files now uncovered.

16057 of 39003 relevant lines covered (41.17%)

0.76 hits per line

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

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

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

10

11
class SecureNextLink(Hidden):
2✔
12
    def render(self, form, context, template_pack=TEMPLATE_PACK, **kwargs):
2✔
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)
×
UNCOV
23
        context.update({"input": self})
×
UNCOV
24
        return render_to_string(template, context.flatten())
×
25

26

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

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

UNCOV
38
        self.helper.layout = Layout(
×
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)
×
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