I'm opposed to using return codes, and don't find the reasoning about multiple uses compelling.  At the very least, create one exception class and use it to carry a reason code.  None of these return codes are tested explicitly, except in the tests. If you create an exception, you can carry an actual readable message, which will be simpler and easier to understand than the logging monkey-patching that's happening in the view function now.