id summary reporter owner description type status component version severity resolution keywords cc stage has_patch needs_docs needs_tests needs_better_patch easy ui_ux 19969 More useful error message when defining ForeignKey with invalid first argument Jonas Obrist nobody "When you create a ForeignKey with an invalid first argument (for example None), you get an error message: `AssertionError: ForeignKey(None) is invalid. First parameter to ForeignKey must be either a model, a model name, or the string 'self'` What this does not tell you is what model in what app and what field this error occurs. I therefore propose that this check is moved to contribute_to_class where we have all the information. (For the record if anyone stumbles up on this, you can use `--traceback` which will give you this information)" Cleanup/optimization closed Database layer (models, ORM) 1.5 Normal duplicate Unreviewed 0 0 0 0 0 0