Skip to content

Commit

Permalink
Merge pull request #962 from open-dynaMIX/dep_updates
Browse files Browse the repository at this point in the history
chore: update dependencies
  • Loading branch information
open-dynaMIX authored Nov 3, 2023
2 parents 4660304 + 9cc0466 commit b5178db
Show file tree
Hide file tree
Showing 5 changed files with 717 additions and 643 deletions.
4 changes: 2 additions & 2 deletions api/mysagw/case/tests/__snapshots__/test_case_views.ambr

Large diffs are not rendered by default.

13 changes: 6 additions & 7 deletions api/mysagw/pdf_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import requests
from django.conf import settings
from pypdf import PdfWriter
from pypdf.errors import DependencyError, PdfReadError
from pypdf.errors import FileNotDecryptedError, PdfReadError
from reportlab.lib.pagesizes import A4, mm
from reportlab.lib.utils import ImageReader
from reportlab.pdfgen import canvas
Expand Down Expand Up @@ -78,16 +78,15 @@ def add_caluma_files_to_pdf(pdf, urls):
for file in prepare_files_for_merge(files):
try:
merger.append(file)
except PdfReadError: # pragma: no cover
## faulty pdf
pass
except DependencyError as e:
except FileNotDecryptedError as e:
# we don't support AES encrypted PDFs
if (
not e.args
or not e.args[0] == "PyCryptodome is required for AES algorithm"
not e.args or not e.args[0] == "File has not been decrypted"
): # pragma: no cover
raise
except PdfReadError: # pragma: no cover
## faulty pdf
pass

result = io.BytesIO()

Expand Down
Binary file modified api/mysagw/test_files/test_encrypted.pdf
Binary file not shown.
Loading

0 comments on commit b5178db

Please sign in to comment.