You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a bug in readService.getAffiliation that causes it to always returns None.
q = self._session.query(Affiliations)
if ids: q = q.filter(Affiliations.AffiliationID.in_(ids))
if orgcode: q = q.filter(Organizations.OrganizationCode.ilike(orgcode))
if personfirst: q = q.filter(People.PersonFirstName.ilike(personfirst))
if personlast: q = q.filter(People.PersonLastName.ilike(personlast)).first()
try:
return q.all()
except:
return None
to fix, change the PersonLastName filter to:
if personlast: q = q.filter(People.PersonLastName.ilike(personlast))
Additionally, the following exception is raised AttributeError: 'Affiliations' object has no attribute 'all', but the user is not informed because all of the api functions return None without any error message. Is there a reason for this? The function above could be rewritten as:
q = self._session.query(Affiliations)
if ids: q = q.filter(Affiliations.AffiliationID.in_(ids))
if orgcode: q = q.filter(Organizations.OrganizationCode.ilike(orgcode))
if personfirst: q = q.filter(People.PersonFirstName.ilike(personfirst))
if personlast: q = q.filter(People.PersonLastName.ilike(personlast))
try:
res = q.all() or None
except AttributeError as e:
print(e)
res = None
return res
I suggest that someone update/implement unit tests for all api functions to make sure they work as expected.
The text was updated successfully, but these errors were encountered:
@Castronova or @lsetiawan, can you check if this issue has been addressed? It looks like it was addressed a while ago. Just want to see if we can close this issue. Thanks.
There is a bug in
readService.getAffiliation
that causes it to always returns None.to fix, change the
PersonLastName
filter to:Additionally, the following exception is raised
AttributeError: 'Affiliations' object has no attribute 'all'
, but the user is not informed because all of the api functions return None without any error message. Is there a reason for this? The function above could be rewritten as:I suggest that someone update/implement unit tests for all api functions to make sure they work as expected.
The text was updated successfully, but these errors were encountered: