61 Commits

Author SHA1 Message Date
Navin Karkera
8ca70db552 refactor: xblock api upstream info and course details api (#37971)
- Returns top parent key instead of boolean in upstream info api
- Adds edited_on raw time in course outline api
- Adds has_changes to course details api
2026-02-09 23:09:06 +00:00
Akanshu Aich
2d82d90279 refactor: migrated FEATURES dict settings to top-level in core files and fixed related test files. (#37389)
* refactor: moved remaining feature dicts settings into top-level settings.

* refactor: moved remaining feature dicts settings into top-level settings.

* fix: fixed the test files

* fix: fixed tehe pylint errors

* fix: fixation of the cms ci failure

* fix: fixed remaining feature settings for cms

* fix: added fix for requirements

* fix: added fix for lms tests

* fix: resolved the test views issue

* fix: configured views file and test_views

* fix: fixed lint errors and assertion issues

* fix: added fix for base url issue in test view

* fix: added fix for base_url and assertion issue

* fix: added configurations for base utl fix

* fix: handled none issue for mfe config

* fix: corrected override settings in test views

* fix: added getattr defensive technique for view settings

* fix: reverted views and test_views file

* fix: added settings in views file

* fix: added with patch within functions in test view

* fix: rearranged the features in default_legacy_config

* fix: fixing the tests  with clearing cache

* fix: reverted test views to verify the CI check

* fix: added cache clear in mfe config test

* fix: fixed the patch toggles to override settings

* fix: fixed the lint errors

* fix: changed patch toggle to override settings
2026-01-20 11:55:26 -05:00
Irtaza Akram
33cc1a94ba chore: upstream ProblemBlock exceptions and shared utilities to XBlock (#37806)
* fix: add support for xblock 5.3.0
2026-01-07 13:30:53 +05:00
Chris Chávez
fcf03cc710 feat: get migrations info REST-API added [FC-0112] (#37558)
- Adds the get migrations info REST-API.
- Add missing title to CourseDetails population.
2025-11-14 17:38:40 +00:00
Tarun Tak
18d5abb2f6 chore: Replace pytz with zoneinfo for UTC handling - Part 1 (#37523)
First PR to replace pytz with zoneinfo for UTC handling across codebase.

This PR migrates all UTC timezone handling from pytz to Python’s standard
library zoneinfo. The pytz library is now deprecated, and its documentation
recommends using zoneinfo for all new code. This update modernizes our
codebase, removes legacy pytz usage, and ensures compatibility with
current best practices for timezone management in Python 3.9+. No functional
changes to timezone logic - just a direct replacement for UTC handling.

https://github.com/openedx/edx-platform/issues/33980
2025-10-28 16:23:22 -04:00
coder1918
790a67a0d1 refactor: flatten FEATURES dictionary with backward compatible proxy 2025-09-09 14:11:39 -06:00
Deborah Kaplan
8c923bea24 feat!: removes deprecated v1 certificate behavior (#35562)
* feat!: removes deprecated v1 certificate behavior

this removes the long-deprecated v1  certificate behavior. This removes
the old-style date selection behavior  (ie., not a choice between
*Immediately upon passing*, *End date of course*, *A date after the course
end date*), which is no longer reliably maintained or supported in
Studio or Credentials.

FIXES: #35399
2024-10-02 12:06:57 -04:00
Eugene Dyudyunov
4340a832f7 Add the default enrollment start date on course creation (#30954)
* fix: main page course listing

The course is visible on the main page right after creation when the feature toggle `CREATE_COURSE_WITH_DEFAULT_ENROLLMENT_START_DATE` is on.

So anonymous users can see them and access the course about page
for the courses without valid data (e.g. they will see the default
course overview)

When courses list filtering is processed it checks the `see_exists`
permission for the anonymous user.
Actually, `see_exists` means `can_load` OR `can_enroll`.

`can_load` is False in our case because the course start in the future.

But `can_enroll` returns True because the course's enrollment_start
and enrollment_end dates are blank:
```
enrollment_start = courselike.enrollment_start or datetime.min.replace(tzinfo=UTC)
enrollment_end = courselike.enrollment_end or datetime.max.replace(tzinfo=UTC)
if enrollment_start < now < enrollment_end:
    debug("Allow: in enrollment period")
    return ACCESS_GRANTED
```

Set the enrollment_start the same as a course start by default
2023-08-22 10:42:19 -04:00
Pooja Kulkarni
9245bc0f76 refactor: rename descriptor -> block within openedx/core/djangoapps
Co-authored-by: Agrendalath <piotr@surowiec.it>
2023-04-26 17:10:54 +02:00
DimA
899167f20f fix: [RGOeX-386] about page is available for the course creator
The empty "Course Overview" keep the default value if the
"overview" key in the json request is an empty string.
2023-03-01 12:46:29 -05:00
Sagirov Eugeniy
8f88422c4a test: prepare tests for removing support for children in Old Mongo 2022-10-28 11:43:20 -04:00
Michael Terry
cb1bb7fa64 test: switch default test store to the split store
It's long past time that the default test modulestore was Split,
instead of Old Mongo. This commit switches the default store and
fixes some tests that now fail:
- Tests that didn't expect MFE to be enabled (because we don't
  enable MFE for Old Mongo) - opt out of MFE for those
- Tests that hardcoded old key string formats
- Lots of other random little differences

In many places, I didn't spend much time trying to figure out how to
properly fix the test, and instead just set the modulestore to Old
Mongo.

For those tests that I didn't spend time investigating, I've set
the modulestore to TEST_DATA_MONGO_AMNESTY_MODULESTORE - search for
that string to find further work.
2022-02-04 14:32:50 -05:00
Jawayria
7663592aa6 chore: Applied lint-amnesty on openedx/core/djangoapps 2021-12-09 13:37:27 +05:00
Matt Tuchfarber
622d56026c Certificate Display Settings revamp (round 2) (#28286)
feat: reimagine certificate display settings

The course settings `certificate_available_date` (CAD) and
`certificates_display_behavior` (CDB) were previously
acting indedependantly of one another. They now work in
tandem. This change:
- limits CDB to a dropdown
- removes "early_with_info" and adds "end_with_date"
- only takes CAD into account if "end_with_date" is selected
- Moves CDB to the main course schedule settings page
- updates CourseOverview model and CourseDetails objects to
validate these fields and choose sane defaults if they aren't
expected values

This work was previously done in bd9e7dd (complete with bugs), so this
version is toggleable via the ENABLE_V2_CERT_DISPLAY_SETTINGS setting
2021-08-02 11:30:15 -04:00
Matt Tuchfarber
63cb6a97ff Revert "feat: Reimagine certificate_availability_date and certificates_display_behavior" 2021-07-07 16:53:05 -04:00
Matt Tuchfarber
2a7106acfb feat: reimagine certificate display settings
The course settings `certificate_available_date` (CAD) and
`certificates_display_behavior` (CDB) were previously acting indedependantly
of one another. They now work in tandem. This change:
- limits CDB to a dropdown
- removes "early_with_info" and adds "end_with_date"
- only takes CAD into account if "end_with_date" is selected
- Moves CDB to the main course schedule settings page
- updates CourseOverview to validate these fields and choose sane
defaults if they aren't expected values

Certificates will now show under the following circumstances:
"Immediately upon passing"
certificate_availability_date = null
certificates_display_behavior = "early_no_info"

"End date of course"
certificate_availability_date = null
certificates_display_behavior = "end"

"A date after the course end date"
certificate_availability_date = <date>
certificates_display_behavior = "end_with_date"
2021-07-06 16:45:23 -04:00
Matt Tuchfarber
ed8604534c (feat) Enable course cert sync for all courses
Removes waffle flag restriction for syncing certificate available dates
to the credentials service.
2021-03-16 14:31:11 -04:00
M. Zulqarnain
c8902bed58 refactor: pyupgrade in heartbeat, lang_pref, models (#26916) 2021-03-16 14:15:01 +05:00
Matt Tuchfarber
6c97dfe1e5 Move cert date signals to avoid race conditions
COURSE_CERT_DATE_CHANGE was being called before saving the new data in
the course overview. The listeners were expecting to pull the data out
of the course overview, and thus were only right about half the time.
This moves the signal to trigger after the course publish signals are
handled.
2021-03-04 15:57:21 -05:00
Aarif
cfcb9330b3 replaced unittest assertions pytest assertions (#26568) 2021-02-22 12:24:33 +05:00
M. Zulqarnain
99c169c444 pylint amnesty in heartbeat,header_control and lang_pref (#26369) 2021-02-04 15:32:10 +05:00
Régis Behmo
a16cd71046 Start waffle namespace deprecation
By explicitly importing the legacy namespace classes, we make it clear
that we are using soon-to-be-deprecated classes. We will then be able to
start removing the legacy classes, one module at a time.
2020-12-03 16:06:14 +01:00
Régis Behmo
4586002956 Import waffle classes from edx_toggles instead of waffle_utils
Those classes were ported to edx_toggles. The imports remain in
waffle_utils.__init__ for backward compatibility.
2020-11-03 19:25:37 +01:00
Régis Behmo
307457a255 Simplify hack to obtain waffle module names
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))
2020-09-14 09:30:24 +02:00
Robert Raposa
77e490f057 ARCHBOM-1305: remove deprecated flag_undefined_default (#24426)
This is the final step in removing the deprecated
flag_undefined_default as explained by the following ADR:
https://github.com/edx/edx-platform/blob/master/openedx/core/djangoapps/waffle_utils/docs/decisions/0001-refactor-waffle-flag-default.rst

Notes:

* All uses of flag_undefined_default=False were always
  supposed to have been no-ops.
* All uses of flag_undefined_default=True that are removed
  in this PR have been replaced by migrations in past PRs.
* The temporary metric temp_flag_default_used id no longer
  reporting any data.

ARCHBOM-1305
2020-07-09 09:31:31 -04:00
SaadYousaf
52cfe647b3 syncing certificates on course update on credential side. 2020-06-16 11:58:49 +05:00
Feanil Patel
046feb0cf0 Merge pull request #22649 from edx/feanil/fix_pep8
Fix all E303 pep8 errors.
2019-12-30 13:32:26 -05:00
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -05:00
Feanil Patel
2df8b8226b Merge pull request #22643 from edx/feanil/2to3_asserts
Run `2to3 -f asserts . -w` on edx-platform.
2019-12-30 12:13:42 -05:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
Feanil Patel
70294b0ad2 Run 2to3 -f asserts . -w on edx-platform.
https://docs.python.org/3.5/library/2to3.html#2to3fixer-asserts
2019-12-30 10:22:19 -05:00
Amit
3a1c68fb30 INCR-243: Make compatible with Python 3.x without breaking Python 2.7 support for openedx/core/djangoapps/models openedx/core/djangoapps/debug (#20532) 2019-05-13 09:29:07 -04:00
Matthew Piatetsky
f294b1a374 fix unicode strings in openedx/ part 1 2019-02-13 10:47:35 -05:00
Michael Youngstrom
4bbd1dee0b Remove shards from commonlib-unit tests 2019-02-12 14:28:35 -05:00
Jeremy Bowman
c290bf8a07 TE-2524 Stop using nose.plugins - openedx 2018-08-02 14:54:50 -04:00
Giulio Gratta
56ac149962 Add custom HTML to Course About page sidebar
This allows course staff to add arbitrary HTML to the sidebar on the About page.

A waffle switch has been added in the course_experience app to allow enabling and disabling of this feature.
2018-06-01 14:26:05 -04:00
Bill DeRusha
d4b57bc218 Removed self-paced feature flag from code 2018-02-26 13:44:53 -05:00
Jeremy Bowman
113e8dde61 PLAT-1885 Stop using deprecated BlockUsageLocator properties 2018-01-12 16:40:21 -05:00
John Eskew
7dfb6cc681 Change all UTC timezones to import from pytz instead of Django. 2017-10-05 11:12:52 -04:00
Nimisha Asthagiri
5193649956 Update Schedules when start date changes on non-live courses 2017-09-10 08:41:26 -04:00
Sanford Student
bf7b3eab1a add cert available date to CMS settings 2017-08-01 10:44:42 -04:00
Gregory Martin
921950d7eb update 2017-07-14 15:12:51 -04:00
rabiaiftikhar
7bf0674de8 EDUCATOR-394 disable self-generated certificates when course is reset to instructor-paced 2017-06-14 19:46:59 +05:00
Noraiz Anwar
371c422aaf Revert "EDUCATOR-394 Disable self generation certificates when course is reset to instructor-paced." 2017-06-14 15:57:07 +05:00
rabiaiftikhar
22d3b02807 respond to comments 2017-06-13 16:29:17 +05:00
rabiaiftikhar
b84d4c0209 Review Rehan 2017-06-13 15:43:36 +05:00
rabia23
a8913f9a66 Review Alex 2017-06-13 06:51:38 +00:00
rabia23
955c64470e reset self-generation of certs according to course pacing 2017-06-11 09:48:29 +00:00
John Eskew
3b57542ab0 Revert "Merge pull request #15170 from edx/jeskew/PLAT_1316_partitions_inheritance"
This reverts commit f97f052591, reversing
changes made to 800bcd8e20.
2017-05-30 12:42:54 -04:00
John Eskew
76389d8678 Run all files touched in inheritance/partition work through isort. 2017-05-25 13:24:08 -04:00