Skip to content

Commit

Permalink
Remove the magic string from publisher upload error since it's been r…
Browse files Browse the repository at this point in the history
…emoved from the message
  • Loading branch information
Steven-Eardley committed Apr 11, 2024
1 parent 518381b commit 17eda8e
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions portality/view/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,8 @@ def upload_file():
job = IngestArticlesBackgroundTask.prepare(current_user.id, upload_file=f, schema=schema, url=url, previous=previous)
IngestArticlesBackgroundTask.submit(job)
except TaskException as e:
magic = str(uuid.uuid1())
flash(Messages.PUBLISHER_UPLOAD_ERROR.format(error_str="", id=magic))
app.logger.exception('File upload error. ' + magic)
flash(Messages.PUBLISHER_UPLOAD_ERROR.format(error_str=str(e)))
app.logger.exception('File upload error. ' + str(e))
return resp
except BackgroundException as e:
if str(e) == Messages.NO_FILE_UPLOAD_ID:
Expand All @@ -223,10 +222,8 @@ def upload_file():
schema = ""
return render_template('publisher/uploadmetadata.html', previous=previous, schema=schema, error=True)


magic = str(uuid.uuid1())
flash(Messages.PUBLISHER_UPLOAD_ERROR.format(error_str=str(e), id=magic))
app.logger.exception('File upload error. ' + magic + '; ' + str(e))
flash(Messages.PUBLISHER_UPLOAD_ERROR.format(error_str=str(e)))
app.logger.exception('File upload error. ' + str(e))
return resp

if f is not None and f.filename != "":
Expand Down

0 comments on commit 17eda8e

Please sign in to comment.