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

iplweb / bpp / 8b645929-e463-4fa4-b2aa-ea52fecf8ad5

02 Jul 2025 09:06AM UTC coverage: 46.671% (+2.5%) from 44.2%
8b645929-e463-4fa4-b2aa-ea52fecf8ad5

push

circleci

mpasternak
Merge branch 'release/v202507.1183'

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

765 existing lines in 44 files now uncovered.

17336 of 37145 relevant lines covered (46.67%)

1.21 hits per line

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

41.67
src/crossref_bpp/forms.py
1
import logging
3✔
2

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

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

10

11
class PobierzZCrossrefAPIForm(forms.Form):
3✔
12
    identyfikator_doi = forms.CharField(
3✔
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):
3✔
UNCOV
20
        v = self.cleaned_data["identyfikator_doi"]
×
UNCOV
21
        return normalize_doi(v)
×
22

23
    def clean(self):
3✔
UNCOV
24
        doi = self.cleaned_data.get("identyfikator_doi")
×
UNCOV
25
        if doi is None:
×
26
            raise ValidationError("Podaj identyfikator DOI")
×
UNCOV
27
        try:
×
UNCOV
28
            data = CrossrefAPICache.objects.get_by_doi(doi)
×
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:
×
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
×
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