* Submit a completion when receiving a completion event from an XBlock. * Handle legacy progress events. * Convert handler to use a dispatch dict instead of an if-else chain. * Extract masquerade checking from individual handlers. * Gate submit_completion on waffle switch * 404 on handler views when trying to submit completion without waffle switch enabled. OC-3087 Disallow calling submit_completion when waffle flag is disabled. Add tests that trying to publish completion errors.
21 lines
562 B
Python
21 lines
562 B
Python
"""
|
|
This module contains various configuration settings via
|
|
waffle switches for the completion app.
|
|
"""
|
|
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
|
|
from openedx.core.djangoapps.waffle_utils import WaffleSwitchNamespace
|
|
|
|
# Namespace
|
|
WAFFLE_NAMESPACE = 'completion'
|
|
|
|
# Switches
|
|
ENABLE_COMPLETION_TRACKING = 'enable_completion_tracking'
|
|
|
|
|
|
def waffle():
|
|
"""
|
|
Returns the namespaced, cached, audited Waffle class for completion.
|
|
"""
|
|
return WaffleSwitchNamespace(name=WAFFLE_NAMESPACE, log_prefix='completion: ')
|