From 45a62edca636b200cd014d4e3a8c500c44a3a6b9 Mon Sep 17 00:00:00 2001
From: Jorran de Wit <jorrandewit@outlook.com>
Date: Mon, 14 Aug 2017 18:14:12 +0200
Subject: [PATCH] Fix arXiv auto-found pdf is already byte type

---
 submissions/forms.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/submissions/forms.py b/submissions/forms.py
index 32c820740..37edb4551 100644
--- a/submissions/forms.py
+++ b/submissions/forms.py
@@ -672,7 +672,7 @@ class iThenticateReportForm(forms.ModelForm):
                                       ' Please upload the pdf manually.'))
                 self.fields['file'] = forms.FileField()
         elif not doc_id and cleaned_data.get('file'):
-            cleaned_data['document'] = cleaned_data['file']
+            cleaned_data['document'] = cleaned_data['file'].read()
         elif doc_id:
             self.document_id = doc_id
 
@@ -743,7 +743,7 @@ class iThenticateReportForm(forms.ModelForm):
         # Finally, upload the file
         author = self.submission.authors.first()
         response = client.documents.add(
-            self.document.read(),
+            self.document,
             folder_id,
             author.user.first_name,
             author.user.last_name,
-- 
GitLab