The existing code used the USE_CACHE_FOR_HAWK_NONCE setting
without first checking that the setting was defined. For
an application that has not defined the setting, an AttributeError
is thrown in the construction of the receiver object, but
subsequent middleware code allows the request flow to process
normally. The usage documentation states:
"By default, Django uses in-memory caching so by default
nonce checking will be activated".
This change supports the documented behavior by assigning a True
value to this setting when authenticated if the setting has
not been defined in the application.
The existing code used the USE_CACHE_FOR_HAWK_NONCE setting without first checking that the setting was defined. For an application that has not defined the setting, an AttributeError is thrown in the construction of the receiver object, but subsequent middleware code allows the request flow to process normally. The usage documentation states:
"By default, Django uses in-memory caching so by default nonce checking will be activated".
This change supports the documented behavior by assigning a True value to this setting when authenticated if the setting has not been defined in the application.