class SliceRequestView (LoginRequiredAutoLogoutView):
def authority_hrn_initial (self, request):
- authorities_query = Query.get('authority').\
- select('name', 'authority_hrn')
+ #authorities_query = Query.get('authority').\
+ # select('name', 'authority_hrn')
- onelab_enabled_query = Query.get('local:platform').filter_by('platform', '==', 'ple-onelab').filter_by('disabled', '==', 'False')
- onelab_enabled = not not execute_admin_query(request, onelab_enabled_query)
- if onelab_enabled:
- authorities_query = authorities_query.filter_by('authority_hrn', 'included', ['ple.inria', 'ple.upmc'])
+ #onelab_enabled_query = Query.get('local:platform').filter_by('platform', '==', 'ple-onelab').filter_by('disabled', '==', 'False')
+ #onelab_enabled = not not execute_admin_query(request, onelab_enabled_query)
+ #if onelab_enabled:
+ authorities_query = Query.get('ple:authority').select('name', 'authority_hrn').filter_by('authority_hrn', 'included', ['ple.inria', 'ple.upmc', 'ple.ibbtple','ple.nitos'])
authorities = execute_admin_query(request, authorities_query)
- #authorities = sorted(authorities)
+ authorities = sorted(authorities)
authority_hrn_tuples = [ (authority['authority_hrn'], authority['name'] if authority['name'] else authority['authority_hrn'],) for authority in authorities ]
print "authority_hrn_tuples=", authority_hrn_tuples
cc_myself = form.cleaned_data['cc_myself']
# The recipients are the PI of the authority
- recipients = authority_get_pi_emails(request,authority_hrn)
- #recipients = ['yasin.upmc@gmail.com','jordan.auge@lip6.fr']
+ recipients = authority_get_pi_emails(request, authority_hrn)
+
if cc_myself:
recipients.append(email)
msg = render_to_string('slice-request-email.txt', form.cleaned_data)
+ print "email, msg, email, recipients", email , msg, email, recipients
send_mail("Onelab user %s requested a slice"%email , msg, email, recipients)
return render(request,'slice-request-ack-view.html') # Redirect after POST