Skip to content
Snippets Groups Projects
Commit 0c4f5c47 authored by kaloyane's avatar kaloyane
Browse files

[LMS-2389] bugfix

SVN: 22056
parent 7045df85
No related branches found
No related tags found
No related merge requests found
...@@ -186,19 +186,27 @@ def commit_transaction(service, transaction): ...@@ -186,19 +186,27 @@ def commit_transaction(service, transaction):
def sendEmail(title, content, isError): def sendEmail(title, content, isError):
recipients = [] recipients = []
recipientsProp = experiment.getPropertyValue(EXPERIMENT_RECIPIENTS_PROPCODE) experimentDetected = False
if recipientsProp:
recipients = [ email.strip() for email in recipientsProp.split(",") ] if vars().has_key("experiment"):
experimentDetected = True
recipientsProp = experiment.getPropertyValue(EXPERIMENT_RECIPIENTS_PROPCODE)
if recipientsProp:
recipients = [ email.strip() for email in recipientsProp.split(",") ]
if not recipients and isError: if not recipients and isError:
recipients = [ email.tryGetEmailAddress() for email in state.getErrorEmailRecipients() ] recipients = [ email.tryGetEmailAddress() for email in state.getErrorEmailRecipients() ]
if not recipients: if not recipients:
state.operationLog.error("Failed to obtain e-mail recipients for experiment " if experimentDetected:
"'%s'. No e-mails will be sent. Please, set a value of the experiment's property '%s'." experimentMsg = ("Please, fill in e-mail recipients list in the property '%s' of experiment '%s'." % (EXPERIMENT_RECIPIENTS_PROPCODE, experiment.getExperimentIdentifier()))
else :
experimentMsg = ""
state.operationLog.error("Failed to detected e-mail recipients for incoming folder '%s'.%s"
" No e-mails will be sent."
"\nEmail title: %s" "\nEmail title: %s"
"\nEmail content: %s" % "\nEmail content: %s" %
(experiment.getExperimentIdentifier(), EXPERIMENT_RECIPIENTS_PROPCODE, title, content)) (incoming.getName(), experimentMsg, title, content))
return return
fromAddress = From("openbis@sanofi-aventis.com") fromAddress = From("openbis@sanofi-aventis.com")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment