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

EQAR / eqar_backend / e01b66e3-7b01-4ac2-bdbe-46705f1eec5e

30 Mar 2025 08:23PM UTC coverage: 87.665% (+11.4%) from 76.228%
e01b66e3-7b01-4ac2-bdbe-46705f1eec5e

push

circleci

web-flow
Merge pull request #537 from EQAR/development

fix institution index signal for Meilisearch

8 of 9 new or added lines in 1 file covered. (88.89%)

288 existing lines in 28 files now uncovered.

10255 of 11698 relevant lines covered (87.66%)

0.88 hits per line

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

87.5
/adminapi/fields.py
1
import io
1✔
2

3
from drf_extra_fields.fields import Base64FileField
1✔
4
from drf_yasg import openapi
1✔
5
from pypdf import PdfReader
1✔
6
from pypdf.errors import PdfReadError
1✔
7
from rest_framework import serializers
1✔
8

9

10
class PDFBase64File(Base64FileField):
1✔
11
    ALLOWED_TYPES = ['pdf']
1✔
12

13
    def get_file_extension(self, filename, decoded_file):
1✔
14
        try:
1✔
15
            PdfReader(io.BytesIO(decoded_file))
1✔
16
        except PdfReadError as e:
×
UNCOV
17
            raise serializers.ValidationError("File is not a valid pdf file")
×
18
        else:
19
            return 'pdf'
1✔
20

21
    class Meta:
1✔
22
        swagger_schema_fields = {
1✔
23
            'type': openapi.TYPE_STRING,
24
            'read_only': False  # <-- FIX
25
        }
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