Suggestion:
If one day we decide to change the way the hash is computed, we may forget to update this method. I think you should add a static method compute_file_hash(<file_path>) (or something like that) in backend/pdf/doc.py:PdfDoc --> it would allow to refactor a little bit the code and make sure that we compute the hash the same way here and in PdfDoc.get_docfilehash()