I have written basic queueing function which returns oldest used API credentials. It works perfectly in database, however when i call it in python it returns correct credentials