Handle PRODUCTION not being defined.

Review Request #13927 — Created June 3, 2024 and submitted — Latest diff uploaded

Information

Djblets
release-5.x

Reviewers

We introduced the new PRODUCTION setting in order to add a separation
between things which enable debug logging, and things which should
always be enabled (or disabled) in production vs. in the devserver. This
was done because a lot of server admins like to set DEBUG to True if
they're having some issue, and this would often cause their whole system
to break.

In Djblets, we can't guarantee that PRODUCTION will exist in the
settings object. This change makes it so we fall back to the DEBUG
setting if it's not present.

  • Ran unit tests.
  • Tried removing PRODUCTION from settings and saw that these things
    still worked.

Changes between revision 1 and 2

orig
1
2

Commits

Summary ID Author
Handle PRODUCTION not being defined.
We introduced the new PRODUCTION setting in order to add a separation between things which enable debug logging, and things which should always be enabled (or disabled) in production vs. in the devserver. This was done because a lot of server admins like to set DEBUG to True if they're having some issue, and this would often cause their whole system to break. In Djblets, we can't guarantee that PRODUCTION will exist in the settings object. This change makes it so we fall back to the DEBUG setting if it's not present. Testing Done: - Ran unit tests. - Tried removing PRODUCTION from settings and saw that these things still worked.
ea72a639b44e420d208b605132880f46a2a9bc61 David Trowbridge
Handle PRODUCTION not being defined.
We introduced the new PRODUCTION setting in order to add a separation between things which enable debug logging, and things which should always be enabled (or disabled) in production vs. in the devserver. This was done because a lot of server admins like to set DEBUG to True if they're having some issue, and this would often cause their whole system to break. In Djblets, we can't guarantee that PRODUCTION will exist in the settings object. This change makes it so we fall back to the DEBUG setting if it's not present. Testing Done: - Ran unit tests. - Tried removing PRODUCTION from settings and saw that these things still worked.
b48de73af4fa8d49faa8af5ebd6e5193e0f9838b David Trowbridge
djblets/webapi/resources/root.py
djblets/webapi/tests/test_root_resource.py
Loading...