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

iplweb / bpp / ba6f9e1f-4683-40a1-aae1-40dd0fcb64e3

25 Aug 2025 06:57PM UTC coverage: 43.284% (+0.6%) from 42.715%
ba6f9e1f-4683-40a1-aae1-40dd0fcb64e3

push

circleci

mpasternak
Merge branch 'release/v202508.1208'

77 of 961 new or added lines in 27 files covered. (8.01%)

731 existing lines in 54 files now uncovered.

17273 of 39906 relevant lines covered (43.28%)

0.78 hits per line

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

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

3
from django import forms
2✔
4
from django.core.exceptions import ValidationError
2✔
5
from django.db import models
2✔
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
2✔
10

11

12
class CommaDecimalField(forms.DecimalField):
2✔
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):
2✔
NEW
19
        if value in self.empty_values:
1✔
NEW
20
            return None
1✔
21

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

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

30

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

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

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