Please be aware of the Forum Rules of Conduct.
The problem with "showing code" is that a fragment of code without the models, libraries, database structure and so on is really meaningless. It tells you nothing whatsoever.