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

iplweb / bpp / 6d44c0b3-f0a3-49ae-83a8-7930c72fa7ab

20 Aug 2025 08:18PM UTC coverage: 43.613% (-2.8%) from 46.448%
6d44c0b3-f0a3-49ae-83a8-7930c72fa7ab

push

circleci

mpasternak
Merge tag 'v202508.1192' into dev

Nowa wersja: v202508.1192 v202508.1192

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

2206 existing lines in 121 files now uncovered.

16630 of 38131 relevant lines covered (43.61%)

0.8 hits per line

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

75.0
src/crossref_bpp/forms.py
1
import logging
2✔
2

3
from django import forms
2✔
4
from django.core.exceptions import ValidationError
2✔
5
from sentry_sdk import capture_exception
2✔
6

7
from crossref_bpp.models import CrossrefAPICache
2✔
8
from import_common.normalization import normalize_doi
2✔
9

10

11
class PobierzZCrossrefAPIForm(forms.Form):
2✔
12
    identyfikator_doi = forms.CharField(
2✔
13
        label="Identyfikator DOI",
14
        help_text="... może być również adres URL http://dx.doi.org/... lub http://doi.org/...",
15
        required=True,
16
        widget=forms.TextInput(attrs={"style": "width: 512px"}),
17
    )
18

19
    def clean_identyfikator_doi(self):
2✔
UNCOV
20
        v = self.cleaned_data["identyfikator_doi"]
1✔
UNCOV
21
        return normalize_doi(v)
1✔
22

23
    def clean(self):
2✔
UNCOV
24
        doi = self.cleaned_data.get("identyfikator_doi")
1✔
UNCOV
25
        if doi is None:
1✔
26
            raise ValidationError("Podaj identyfikator DOI")
×
UNCOV
27
        try:
1✔
UNCOV
28
            data = CrossrefAPICache.objects.get_by_doi(doi)
1✔
29
        except Exception as e:
×
30
            capture_exception(e)
×
31
            logging.exception(e)
×
32
            raise ValidationError(f"Podczas pobierania danych wystąpił błąd {e}")
×
33

UNCOV
34
        if data is None:
1✔
35
            raise ValidationError(
×
36
                f'Dla podanego DOI "{doi}" nie znaleziono nic po stronie CrossRef API'
37
            )
38

UNCOV
39
        self.cleaned_data["json_data"] = data
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