mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-12 09:00:40 +00:00
Add user id to path.
This commit is contained in:
@ -34,7 +34,10 @@ def ocr():
|
||||
db.session.add(ocr_job)
|
||||
db.session.commit()
|
||||
|
||||
dir = os.path.join(app.config['OPAQUE_STORAGE'], 'jobs', str(ocr_job.id))
|
||||
dir = os.path.join(app.config['OPAQUE_STORAGE'],
|
||||
str(ocr_job.user_id),
|
||||
'jobs',
|
||||
str(ocr_job.id))
|
||||
|
||||
try:
|
||||
os.makedirs(dir)
|
||||
@ -67,9 +70,6 @@ def nlp():
|
||||
new_nlp_job_form = NewNLPJobForm()
|
||||
if new_nlp_job_form.validate_on_submit():
|
||||
app = current_app._get_current_object()
|
||||
id = hashlib.md5(
|
||||
(current_user.username + '_' + datetime.now().isoformat()).encode()
|
||||
).hexdigest()
|
||||
nlp_job = Job()
|
||||
nlp_job.title = new_nlp_job_form.title.data
|
||||
nlp_job.description = new_nlp_job_form.description.data
|
||||
@ -84,7 +84,11 @@ def nlp():
|
||||
nlp_job.status = "queued"
|
||||
db.session.add(nlp_job)
|
||||
db.session.commit()
|
||||
dir = os.path.join(app.config['OPAQUE_STORAGE'], 'jobs', str(nlp_job.id))
|
||||
|
||||
dir = os.path.join(app.config['OPAQUE_STORAGE'],
|
||||
str(nlp_job.user_id),
|
||||
'jobs',
|
||||
str(nlp_job.id))
|
||||
|
||||
try:
|
||||
os.makedirs(dir)
|
||||
|
Reference in New Issue
Block a user