Why not use `kwargs.pop('current_user', None)`? Would make the next two lines obsolete.