Instead of going up the stacktrace to find the module names of waffle
flags and switches, we manually pass the module __name__ whenever the
flag is created. This is similar to `logging.getLogger(__name__)`
standard behaviour.
As the waffle classes are used outside of edx-platform, we make the new
module_name argument an optional keyword argument. This will change once
we pull waffle_utils outside of edx-platform.
Note that the module name is normally only required to view the list of
existing waffle flags and switches. The module name should not be
necessary to verify if a flag is enabled. Thus, maybe it would make
sense to create a `add` class methor similar to:
class WaffleFlag:
@classmethod
def add(cls, namespace, flag, module):
instance = cls(namespace, flag)
cls._class_instances.add((instance, module))
Reuse of the variable paid_modes was causing the code to follow an
incorrect path. Changed the filtering version of the variable to
paid_modes_only. Had to keep both variables temporarily until I can fix
plugin code that uses this API.
Checking if a user was enrolled in a program type was using the `name`
field which is subject to be translated. This change allows for us to check by
the type's slug which will be constant. This also includes the addition
of api.py files for the course_modes, catalog, and programs apps.
Make demographics collection banner on dashboard use new demographics
API which checks enterprise as well. Also expose serialization of
CourseEnrollments.
These removed tests can be restored once someone works out why they
were causing flakiness elsewhere and fix the problem.
Reverts tests added in:
dca50aacc3
This stage does the following:
- Includes a data migration to copy the values from old to new field.
- Changes business logic to switch to using new field.
- Deletes all code references of the old field.
This reverts commit 84de6bc6de
which reverts commit cebeab4348
which implements the first stage of the `values` column rename in
SiteConfiguration. However, I included a small change:
This time, we set a default value on the new `site_values` column so
that the ORM will happily deserialize the JSONField without throwing a
JSONDecodeError.
BackPopulate Program Credentials job performs data for all the programs
and for all the available learners which takes a lot of time.
Adding in custom arguments will help run this job for specific learners
and specific programs.
* INCR-250: Make compatible with Python 3.x without breaking Python 2.7 support --> openedx/core/djangoapps/programs
* INCR-250: Disable pylint warning and replace _f placeholder with actual name
* INCR-250: pylint format correction and fix over length line limit
* INCR-239: Run python-modernize and isort on openedx/core/djangoapps/programs [tests, tasks]
* INCR-239: Grouped six package and represent unused variables with _
* INCR-213 run modernizer on djangoapps migrations & management
* fix python 2 to 3 pylint redefined built in `reduce` warning
* regroup imports
* group the `__future__` imports in programs migration files
LEARNER-7086. Uses a new model manager for GeneratedCertificate that excludes
certificates whose course_id does not correspond to a valid CourseOverview