Skip to content

Commit

Permalink
Implemented CUSTOMHTML_PROJECTFAILED (+ fix for CUSTOMHTML_PROJECTDONE)
Browse files Browse the repository at this point in the history
  • Loading branch information
proycon committed Mar 19, 2018
1 parent 3fc11e3 commit 55727a1
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions clam/clamservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,9 @@ def response(user, project, parameters, errormsg = "", datafile = False, oauth_a
errors = "yes"
errormsg = "An error occurred within the system. Please inspect the error log for details"
printlog("Child process failed, exited with non zero-exit code.")
customhtml = settings.CUSTOMHTML_PROJECTDONE
customhtml = settings.CUSTOMHTML_PROJECTFAILED
else:
customhtml = settings.CUSTOMHTML_PROJECTDONE
else:
outputpaths = [] #pylint: disable=redefined-variable-type

Expand Down Expand Up @@ -2668,11 +2670,17 @@ def set_defaults():
else:
settings.CUSTOMHTML_PROJECTSTART = ""
if not 'CUSTOMHTML_PROJECTDONE' in settingkeys:
if os.path.exists(settings.CLAMDIR + '/static/custom/' + settings.SYSTEM_ID + '_projectstart.html'):
with io.open(settings.CLAMDIR + '/static/custom/' + settings.SYSTEM_ID + '_projectstart.html','r',encoding='utf-8') as f:
if os.path.exists(settings.CLAMDIR + '/static/custom/' + settings.SYSTEM_ID + '_projectdone.html'):
with io.open(settings.CLAMDIR + '/static/custom/' + settings.SYSTEM_ID + '_projectdone.html','r',encoding='utf-8') as f:
settings.CUSTOMHTML_PROJECTDONE = f.read()
else:
settings.CUSTOMHTML_PROJECTDONE = ""
if not 'CUSTOMHTML_PROJECTFAILED' in settingkeys:
if os.path.exists(settings.CLAMDIR + '/static/custom/' + settings.SYSTEM_ID + '_projectfailed.html'):
with io.open(settings.CLAMDIR + '/static/custom/' + settings.SYSTEM_ID + '_projectfailed.html','r',encoding='utf-8') as f:
settings.CUSTOMHTML_PROJECTFAILED = f.read()
else:
settings.CUSTOMHTML_PROJECTFAILED = ""

if not 'CUSTOM_FORMATS' in settingkeys:
settings.CUSTOM_FORMATS = []
Expand Down

0 comments on commit 55727a1

Please sign in to comment.