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

iplweb / bpp / 3c407b5b-8434-4f25-9e12-005b14d23a79

07 Sep 2025 02:53PM UTC coverage: 33.615% (-8.7%) from 42.328%
3c407b5b-8434-4f25-9e12-005b14d23a79

push

circleci

mpasternak
Merge branch 'release/v202509.1221'

1 of 45 new or added lines in 2 files covered. (2.22%)

3993 existing lines in 129 files now uncovered.

16522 of 49150 relevant lines covered (33.62%)

0.34 hits per line

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

63.64
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✔
UNCOV
19
        if value in self.empty_values:
×
UNCOV
20
            return None
×
21

UNCOV
22
        if isinstance(value, str):
×
UNCOV
23
            value = value.replace(",", ".")
×
24

UNCOV
25
        try:
×
UNCOV
26
            return Decimal(str(value))
×
27
        except (ValueError, InvalidOperation):
×
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