these 3 lines could be simplified using details.get('errors', None) perhaps. Not a blocker.