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

iplweb / bpp / 18634744198

19 Oct 2025 07:00PM UTC coverage: 31.618% (-29.9%) from 61.514%
18634744198

push

github

mpasternak
Merge branch 'release/v202510.1270'

657 of 9430 branches covered (6.97%)

Branch coverage included in aggregate %.

229 of 523 new or added lines in 42 files covered. (43.79%)

11303 existing lines in 316 files now uncovered.

14765 of 39346 relevant lines covered (37.53%)

0.38 hits per line

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

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

4
import rollbar
1✔
5
from django import forms
1✔
6
from django.core.exceptions import ValidationError
1✔
7

8
from crossref_bpp.models import CrossrefAPICache
1✔
9
from import_common.normalization import normalize_doi
1✔
10

11

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

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

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

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

40
        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