X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Factions.py;h=d62f9941e4a2fb2fb84bf9548f2152036d0b7385;hb=e17c4ff5fd80bb24573047eb832ea6ca5c2fc73e;hp=8b1713e74068476cfbeeaca5d9d0e47504e4ca1e;hpb=06be272232c9f387a12ad10ee87f798720bb6938;p=unfold.git diff --git a/portal/actions.py b/portal/actions.py index 8b1713e7..d62f9941 100644 --- a/portal/actions.py +++ b/portal/actions.py @@ -252,7 +252,7 @@ def get_request_by_id(ids): def get_requests(authority_hrns=None): print "get_request_by_authority auth_hrns = ", authority_hrns if not authority_hrns: - ## get those pending users who have validated their emails + ## get those pending users who have confirmed their emails pending_users = PendingUser.objects.filter(status__iexact = 'True') pending_slices = PendingSlice.objects.all() pending_authorities = PendingAuthority.objects.all() @@ -321,13 +321,14 @@ def portal_validate_request(wsgi_request, request_ids): # 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) @@ -376,6 +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 = { @@ -391,6 +394,13 @@ def create_slice(wsgi_request, request): 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): @@ -505,6 +515,10 @@ def sfa_create_user(wsgi_request, request): 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):