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

iplweb / bpp / 5dc7ed31-9a4c-4fc3-95d2-edb924c869f1

22 Aug 2025 01:06PM UTC coverage: 40.365% (-0.001%) from 40.366%
5dc7ed31-9a4c-4fc3-95d2-edb924c869f1

push

circleci

mpasternak
Merge tag 'v202508.1201' into dev

Nowa wersja: v202508.1201 v202508.1201

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

1213 existing lines in 78 files now uncovered.

15413 of 38184 relevant lines covered (40.37%)

0.4 hits per line

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

71.43
src/bpp/apps.py
1
from django.apps import AppConfig
1✔
2

3

4
class BppConfig(AppConfig):
1✔
5
    name = "bpp"
1✔
6
    verbose_name = "Biblioteka Publikacji Pracowników"
1✔
7

8
    def ready(self):
1✔
9
        from django.db.models.signals import post_migrate
1✔
10

11
        from bpp.system import odtworz_grupy, ustaw_robots_txt
1✔
12

13
        post_migrate.connect(ustaw_robots_txt, sender=self)
1✔
14
        post_migrate.connect(odtworz_grupy, sender=self)
1✔
15

16
        # Ensure BppUserAdmin takes precedence over microsoft_auth's UserAdmin
17
        self._register_bpp_user_admin()
1✔
18

19
    def _register_bpp_user_admin(self):
1✔
20
        """Re-register BppUserAdmin to override any previous registrations."""
21

22
        # microsoft_auth at the currently used version modifies USER_MODEL admin form.
23
        # bpp.admin also wants to modify it. With the current Django module resolution,
24
        # the bpp.admin is imported, then bpp.apps.ready is called, then microsoft_auth.admin
25
        # is imported... this is something we don't want.
26
        #
27
        # So, we import the microsoft_auth.admin here so it gets executed and then we re-register
28
        # the module.
29

30
        try:
1✔
31
            from microsoft_auth import admin  # noqa
1✔
32
        except ImportError:
1✔
33
            # If there is no microsoft_auth module, this whole function is not actually needed.
34
            return
1✔
35

UNCOV
36
        from django.contrib import admin  # noqa
×
37

UNCOV
38
        from bpp.admin import BppUserAdmin
×
UNCOV
39
        from bpp.models import BppUser
×
40

41
        # Unregister any existing admin for BppUser
UNCOV
42
        if BppUser in admin.site._registry:
×
UNCOV
43
            admin.site.unregister(BppUser)
×
44

45
        # Register our BppUserAdmin
UNCOV
46
        admin.site.register(BppUser, BppUserAdmin)
×
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