X-Git-Url: http://woldlab.caltech.edu/gitweb/?a=blobdiff_plain;f=htsworkflow%2Ffrontend%2Fexperiments%2Fviews.py;h=e2f6d884a4d63491922f88434f9e8c40cbb1972d;hb=f1e43a894b2447b87f5f9d4cc6a872fd9aaac7a9;hp=e03c038e48f7f2e197a20ef73494670bcf717076;hpb=657df2390e58bb24848536974b3cb2b2bf0ee8c8;p=htsworkflow.git diff --git a/htsworkflow/frontend/experiments/views.py b/htsworkflow/frontend/experiments/views.py index e03c038..e2f6d88 100755 --- a/htsworkflow/frontend/experiments/views.py +++ b/htsworkflow/frontend/experiments/views.py @@ -1,4 +1,6 @@ # Create your views here. +from datetime import datetime + #from django.template import Context, loader #shortcut to the above modules from django.contrib.auth.decorators import user_passes_test @@ -12,6 +14,8 @@ from django.template.loader import get_template from htsworkflow.frontend.experiments.models import * from htsworkflow.frontend.experiments.experiments import \ estimateFlowcellDuration, \ + estimateFlowcellTimeRemaining, \ + roundToDays, \ getUsersForFlowcell, \ makeEmailLaneMap @@ -64,7 +68,8 @@ def startedEmail(request, pk): email_lane = makeEmailLaneMap(fc) flowcell_users = getUsersForFlowcell(fc) - estimate_low, estimate_high = estimateFlowcellDuration(fc) + estimate = estimateFlowcellTimeRemaining(fc) + estimate_low, estimate_high = roundToDays(estimate) email_verify = get_template('experiments/email_preview.html') email_template = get_template('experiments/started_email.txt') sender = settings.NOTIFICATION_SENDER @@ -87,6 +92,7 @@ def startedEmail(request, pk): u'runfolder': 'blank', u'finish_low': estimate_low, u'finish_high': estimate_high, + u'now': datetime.now(), }) # build view