Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab
authorLoic Baron <loic.baron@lip6.fr>
Thu, 24 Jul 2014 16:11:24 +0000 (18:11 +0200)
committerLoic Baron <loic.baron@lip6.fr>
Thu, 24 Jul 2014 16:11:24 +0000 (18:11 +0200)
1  2 
portal/actions.py

diff --combined portal/actions.py
@@@ -321,14 -321,13 +321,14 @@@ def portal_validate_request(wsgi_reques
                  # XXX tmp sfa dependency
                  from sfa.util.xrn import Xrn 
                  urn = Xrn(hrn, request['type']).get_urn()
 -
 +                
 +                # Only hrn is required for Manifold Query 
                  sfa_authority_params = {
 -                    'hrn'        : hrn,
 -                    'urn'        : urn,
 -                    'type'       : request['type'],
 +                    'authority_hrn'        : hrn,
 +                    #'authority_urn'        : urn,
 +                    #'type'       : request['type'],
                      #'pi'        : None,
 -                    'enabled'    : True
 +                    #'enabled'    : True
                  }
                  print "ADD Authority"
                  sfa_add_authority(wsgi_request, sfa_authority_params)
@@@ -377,6 -376,8 +377,8 @@@ def create_slice(wsgi_request, request)
      # Add User to Slice if we have the user_hrn in pendingslice table
      user_hrn = request.get('user_hrn', None)
      user_hrns = list([user_hrn]) if user_hrn else list()
+     
+     user_email = request.get
  
      # XXX We should create a slice with Manifold terminology
      slice_params = {
      results = execute_query(wsgi_request, query)
      if not results:
          raise Exception, "Could not create %s. Already exists ?" % slice_params['hrn']
+     ## We do not store the email in pendingslice table. As a result receiver's email is unknown ##
+     ## Need modification in pendingslice table ###
+     #else:
+     #    subject = 'Slice created'
+     #    msg = 'A manager of your institution has validated your slice request. You can now add resources to the slice and start experimenting.'
+     #    send_mail(subject, msg, 'support@onelab.eu',['yasin.upmc@gmail.com'], fail_silently=False)
+        
      return results
  
  def create_pending_slice(wsgi_request, request, email):
@@@ -506,6 -514,10 +515,10 @@@ def sfa_create_user(wsgi_request, reque
      results = execute_query(wsgi_request, query)
      if not results:
          raise Exception, "Could not create %s. Already exists ?" % sfa_user_params['user_hrn']
+     else:
+         subject = 'User validated'
+         msg = 'A manager of your institution has validated your account. You have now full user access to the portal.'
+         send_mail(subject, msg, 'support@onelab.eu',[request['email']], fail_silently=False)       
      return results
  
  def create_user(wsgi_request, request):