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

iplweb / bpp / 7d423bde-8caf-4c8b-8bf5-12ad3f831949

22 Aug 2025 01:06PM UTC coverage: 45.781% (+0.06%) from 45.719%
7d423bde-8caf-4c8b-8bf5-12ad3f831949

push

circleci

mpasternak
Merge branch 'release/v202508.1201'

11 of 18 new or added lines in 3 files covered. (61.11%)

1245 existing lines in 104 files now uncovered.

17481 of 38184 relevant lines covered (45.78%)

1.18 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
3✔
2

3

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

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

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

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

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

19
    def _register_bpp_user_admin(self):
3✔
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:
3✔
31
            from microsoft_auth import admin  # noqa
3✔
32
        except ImportError:
3✔
33
            # If there is no microsoft_auth module, this whole function is not actually needed.
34
            return
3✔
35

NEW
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