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

iplweb / bpp / 8f3be493-3d81-46bd-9558-e735393fb9b9

25 Aug 2025 06:57PM UTC coverage: 44.239% (-1.1%) from 45.327%
8f3be493-3d81-46bd-9558-e735393fb9b9

push

circleci

mpasternak
Merge tag 'v202508.1208' into dev

Nowa wersja: v202508.1208 v202508.1208

1 of 1 new or added line in 1 file covered. (100.0%)

1561 existing lines in 81 files now uncovered.

17654 of 39906 relevant lines covered (44.24%)

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

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

UNCOV
25
        try:
1✔
UNCOV
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):
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