I am writing a function which gets users from database and returns a list of user objects. Function signature is as given below:
def select_users(self,userid,firstname,lastname,emailid,tenants,groups):
result = self.authservice.select_users(userid,firstname,lastname,emailid,tenants,groups)
In this function, I call select_users
method of authservice
object which will return a list of custom user objects. But if any of input parameters has ''
value then it must be converted to None
because self.authservice.select_users
cannot handle empty strings. I can check each element value and convert it to None
if it is empty, but I want it to be generic and reusable. If I could write a different function which can give me updated list of input parameters it would be very helpful. Please let me know how do I do that?