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

iplweb / bpp / dedd10c6-fb94-4555-854a-16d9255205b4

24 Aug 2025 08:22PM UTC coverage: 43.704% (-3.2%) from 46.899%
dedd10c6-fb94-4555-854a-16d9255205b4

push

circleci

mpasternak
Merge branch 'release/v202508.1204'

4 of 4 new or added lines in 2 files covered. (100.0%)

739 existing lines in 33 files now uncovered.

16905 of 38681 relevant lines covered (43.7%)

0.79 hits per line

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

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

3

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

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

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

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

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

19
    def _register_bpp_user_admin(self):
2✔
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
        from django.apps import apps
2✔
31

32
        if not apps.is_installed("microsoft_auth"):
2✔
33
            return
2✔
34

UNCOV
35
        try:
×
UNCOV
36
            from microsoft_auth import admin  # noqa
×
UNCOV
37
        except ImportError:
×
38
            # If there is no microsoft_auth module, this whole function is not actually needed.
UNCOV
39
            return
×
40

41
        from django.contrib import admin  # noqa
×
42

43
        from bpp.admin import BppUserAdmin
×
44
        from bpp.models import BppUser
×
45

46
        # Unregister any existing admin for BppUser
47
        if BppUser in admin.site._registry:
×
48
            admin.site.unregister(BppUser)
×
49

50
        # Register our BppUserAdmin
51
        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