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()
# 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)
# 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):
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):
public_key = request['public_key'],
private_key = request['private_key'],
user_hrn = request['user_hrn'],
- pi = '', # XXX Why not None ?
+ pi = request['pi'],
email_hash = request['email_hash'],
status = 'False',
)