• 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

28.57
/apps/exports/mixins.py
1
from django.conf import settings
1✔
2
from django.utils.translation import gettext as _
1✔
3

4
from adhocracy4.exports.mixins import VirtualFieldMixin
1✔
5

6

7
class CommentExportWithCategoriesMixin(VirtualFieldMixin):
1✔
8
    """
9
    Adds categories to the comment export.
10

11
    To be used with comments with categories like in the debate module.
12

13
    ATTENTION: if this export is used elsewhere, do not copy over,
14
    but move to A4 (as the comments are also there!)
15
    """
16

17
    def get_virtual_fields(self, virtual):
1✔
18
        if "categories" not in virtual:
×
19
            virtual["categories"] = _("Categories")
×
20
        return super().get_virtual_fields(virtual)
×
21

22
    def get_categories_data(self, item):
1✔
23
        category_choices = getattr(settings, "A4_COMMENT_CATEGORIES", "")
×
24
        if category_choices:
×
25
            category_choices = dict((x, str(y)) for x, y in category_choices)
×
26
        if hasattr(item, "comment_categories") and item.comment_categories:
×
27
            categories = []
×
28
            category_list = item.comment_categories.strip("[]").split(",")
×
29
            for category in category_list:
×
30
                if category in category_choices:
×
31
                    categories.append(category_choices[category])
×
32
                else:
33
                    categories.append(category)
×
34
            return ", ".join(categories)
×
35
        return ""
×
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