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

iplweb / bpp / 18634744198

19 Oct 2025 07:00PM UTC coverage: 31.618% (-29.9%) from 61.514%
18634744198

push

github

mpasternak
Merge branch 'release/v202510.1270'

657 of 9430 branches covered (6.97%)

Branch coverage included in aggregate %.

229 of 523 new or added lines in 42 files covered. (43.79%)

11303 existing lines in 316 files now uncovered.

14765 of 39346 relevant lines covered (37.53%)

0.38 hits per line

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

90.0
src/bpp/fields.py
1
from decimal import Decimal, InvalidOperation
1✔
2

3
from django import forms
1✔
4
from django.core.exceptions import ValidationError
1✔
5
from django.db import models
1✔
6

7
# Ta klasa na obecną chwilę nie zawiera nic, ale używamy jej, aby oznaczyć
8
# odpowiednio pola, gdzie chodzi o rok:
9
YearField = models.IntegerField
1✔
10

11

12
class CommaDecimalField(forms.DecimalField):
1✔
13
    """
14
    A DecimalField that accepts both comma and period as decimal separators.
15
    Converts comma to period for processing.
16
    """
17

18
    def to_python(self, value):
1✔
19
        if value in self.empty_values:
1✔
20
            return None
1✔
21

22
        if isinstance(value, str):
1!
23
            value = value.replace(",", ".")
1✔
24

25
        try:
1✔
26
            return Decimal(str(value))
1✔
UNCOV
27
        except (ValueError, InvalidOperation):
×
UNCOV
28
            raise ValidationError(self.error_messages["invalid"])
×
29

30

31
class DOIField(models.CharField):
1✔
32
    def __init__(self, *args, **kw):
1✔
33
        if "help_text" not in kw:
1✔
34
            kw["help_text"] = "Digital Object Identifier (DOI)"
1✔
35

36
        if "max_length" not in kw:
1✔
37
            kw["max_length"] = 2048
1✔
38

39
        super().__init__(*args, **kw)
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

© 2026 Coveralls, Inc