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

liqd / adhocracy-plus / 18908688697

29 Oct 2025 12:59PM UTC coverage: 44.622% (-44.5%) from 89.135%
18908688697

Pull #2986

github

web-flow
Merge 1dfde8ee7 into 445e1d498
Pull Request #2986: Draft: Speed up Github Ci Tests

3012 of 6750 relevant lines covered (44.62%)

0.45 hits per line

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

69.44
/apps/documents/dashboard.py
1
from django.urls import reverse
1✔
2
from django.utils.translation import gettext_lazy as _
1✔
3

4
from adhocracy4.dashboard import DashboardComponent
1✔
5
from adhocracy4.dashboard import components
1✔
6
from apps.documents.models import Chapter
1✔
7

8
from . import exports
1✔
9
from . import views
1✔
10

11

12
class DocumentComponent(DashboardComponent):
1✔
13
    identifier = "document_settings"
1✔
14
    weight = 20
1✔
15
    label = _("Document")
1✔
16

17
    def is_effective(self, module):
1✔
18
        return module.blueprint_type == "TR"
×
19

20
    def get_progress(self, module):
1✔
21
        if Chapter.objects.filter(module=module).exists():
×
22
            return 1, 1
×
23
        return 0, 1
×
24

25
    def get_base_url(self, module):
1✔
26
        return reverse(
×
27
            "a4dashboard:dashboard-document-settings",
28
            kwargs={
29
                "organisation_slug": module.project.organisation.slug,
30
                "module_slug": module.slug,
31
            },
32
        )
33

34
    def get_urls(self):
1✔
35
        return [
×
36
            (
37
                r"^modules/(?P<module_slug>[-\w_]+)/document/$",
38
                views.DocumentDashboardView.as_view(component=self),
39
                "dashboard-document-settings",
40
            )
41
        ]
42

43

44
components.register_module(DocumentComponent())
1✔
45

46

47
class ExportDocumentComponent(DashboardComponent):
1✔
48
    identifier = "document_export"
1✔
49
    weight = 50
1✔
50
    label = _("Export Excel")
1✔
51

52
    def is_effective(self, module):
1✔
53
        module_app = module.phases[0].content().app
×
54
        return (
×
55
            module_app == "a4_candy_documents"
56
            and not module.project.is_draft
57
            and not module.is_draft
58
        )
59

60
    def get_progress(self, module):
1✔
61
        return 0, 0
×
62

63
    def get_base_url(self, module):
1✔
64
        return reverse(
×
65
            "a4dashboard:document-export-module",
66
            kwargs={
67
                "organisation_slug": module.project.organisation.slug,
68
                "module_slug": module.slug,
69
            },
70
        )
71

72
    def get_urls(self):
1✔
73
        return [
×
74
            (
75
                r"^modules/(?P<module_slug>[-\w_]+)/export/document/$",
76
                views.DocumentDashboardExportView.as_view(),
77
                "document-export-module",
78
            ),
79
            (
80
                r"^modules/(?P<module_slug>[-\w_]+)/export/document/comments/$",
81
                exports.DocumentExportView.as_view(),
82
                "document-comment-export",
83
            ),
84
        ]
85

86

87
components.register_module(ExportDocumentComponent())
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

© 2025 Coveralls, Inc