" %(user_dict))
hrn = user_dict['hrn']
person_urn = hrn_to_urn(hrn, 'user')
- pubkey = user_dict['pkey']
try:
+ pubkey = user_dict['pkey']
pkey = convert_public_key(pubkey)
except TypeError:
#key not good. create another pkey
- logger.warn('__add_person_to_db: unable to convert public \
+ logger.warn('__add_person_to_db: no public key or unable to convert public \
key for %s' %(hrn ))
pkey = Keypair(create=True)
user_record = RegUser(hrn=hrn , pointer= '-1', \
authority=get_authority(hrn), \
email=user_dict['email'], gid = person_gid)
- user_record.reg_keys = [RegKey(user_dict['pkey'])]
+ #user_record.reg_keys = [RegKey(user_dict['pkey'])]
user_record.just_created()
self.api.dbsession().add (user_record)
self.api.dbsession().commit()
"""
Get the slice record based on the slice hrn. Fetch the record of the
user associated with the slice by using joinedload based on the
- reg_researcher relationship.
+ reg_researchers relationship.
:param slice_filter: the slice hrn we are looking for
:type slice_filter: string
raw_slicerec = self.api.dbsession().query(RegSlice).options(joinedload('reg_researchers')).filter_by(hrn=slice_filter).first()
#raw_slicerec = self.api.dbsession().query(RegRecord).filter_by(hrn = slice_filter).first()
if raw_slicerec:
- #load_reg_researcher
+ #load_reg_researchers
#raw_slicerec.reg_researchers
raw_slicerec = raw_slicerec.__dict__
logger.debug(" IOTLAB_API \t _sql_get_slice_info slice_filter %s \
sfa_record.just_created()
self.api.dbsession().add(sfa_record)
self.api.dbsession().commit()
- #Update the reg-researcher dependance table
+ #Update the reg-researchers dependency table
sfa_record.reg_researchers = [user_record]
self.api.dbsession().commit()