Skip to content

Commit

Permalink
Merge pull request #71 from SADiLaR/feature/mass-upload-fix
Browse files Browse the repository at this point in the history
fixed issue with uploading data and saving
  • Loading branch information
daniel-gray-tangent authored Jun 10, 2024
2 parents b4845c7 + de0746e commit be4cc1c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/general/management/commands/dev_pdf_mass_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ def print_error(self):
def save_data(self, data):
# Generate a random number for the institution ID
random_number = random.randint(1, 20)
content_file = ContentFile(data["uploaded_file"], name=data["title"])

# Read the uploaded file data
with open(data["uploaded_file"], "rb") as f:
get_content_file = f.read()

content_file = ContentFile(get_content_file, name=data["title"])

try:
document_data = GetTextFromPDF(data["uploaded_file"]).to_text()
Expand Down

0 comments on commit be4cc1c

Please sign in to comment.