• 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/topicprio/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

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

11

12
class TopicEditComponent(DashboardComponent):
1✔
13
    identifier = "topic_edit"
1✔
14
    weight = 20
1✔
15
    label = _("Topics")
1✔
16

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

20
    def get_progress(self, module):
1✔
21
        if models.Topic.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:topic-list",
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"^topics/module/(?P<module_slug>[-\w_]+)/$",
38
                views.TopicListDashboardView.as_view(component=self),
39
                "topic-list",
40
            ),
41
            (
42
                r"^topics/create/module/(?P<module_slug>[-\w_]+)/$",
43
                views.TopicCreateView.as_view(component=self),
44
                "topic-create",
45
            ),
46
            (
47
                r"^topics/(?P<year>\d{4})-(?P<pk>\d+)/update/$",
48
                views.TopicUpdateView.as_view(component=self),
49
                "topic-update",
50
            ),
51
            (
52
                r"^topics/(?P<year>\d{4})-(?P<pk>\d+)/delete/$",
53
                views.TopicDeleteView.as_view(component=self),
54
                "topic-delete",
55
            ),
56
        ]
57

58

59
components.register_module(TopicEditComponent())
1✔
60

61

62
class ExportTopicComponent(DashboardComponent):
1✔
63
    identifier = "topic_export"
1✔
64
    weight = 50
1✔
65
    label = _("Export Excel")
1✔
66

67
    def is_effective(self, module):
1✔
68
        module_app = module.phases[0].content().app
×
69
        return (
×
70
            module_app == "a4_candy_topicprio"
71
            and not module.project.is_draft
72
            and not module.is_draft
73
        )
74

75
    def get_progress(self, module):
1✔
76
        return 0, 0
×
77

78
    def get_base_url(self, module):
1✔
79
        return reverse(
×
80
            "a4dashboard:topic-export-module",
81
            kwargs={
82
                "organisation_slug": module.project.organisation.slug,
83
                "module_slug": module.slug,
84
            },
85
        )
86

87
    def get_urls(self):
1✔
88
        return [
×
89
            (
90
                r"^modules/(?P<module_slug>[-\w_]+)/export/topic/$",
91
                views.TopicDashboardExportView.as_view(),
92
                "topic-export-module",
93
            ),
94
            (
95
                r"^modules/(?P<module_slug>[-\w_]+)/export/topic/maptopics/$",
96
                exports.TopicExportView.as_view(),
97
                "topic-export",
98
            ),
99
            (
100
                r"^modules/(?P<module_slug>[-\w_]+)/export/topic/comments/$",
101
                exports.TopicCommentExportView.as_view(),
102
                "topic-comment-export",
103
            ),
104
        ]
105

106

107
components.register_module(ExportTopicComponent())
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