openedx / openedx/edx-when

get_overrides_for_block and get_overrides_for_course return reset/reverted overrides

Open
#353 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3
Forks
14
Avg merge
3d 16h
Merged PRs (30d)
2

Description

Description

When a due date extension is reset via set_date_for_block(course_id, block_id, 'due', None, user=student), a new UserDate record is created with abs_date=None and rel_date=None. The actual_date property on this record falls back to the original ContentDate policy date, making it indistinguishable from an active extension.

Both get_overrides_for_block and get_overrides_for_course return these reset records because they query all UserDate rows (most recent per user/block) without checking whether the override actually differs from the base date.

This forces every consumer to independently filter out reset overrides. Currently, edx-platform works around this in the v2 instructor API (UnitExtensionsView): https://github.com/openedx/openedx-platform/pull/38394

Expected behavior

get_overrides_for_block and get_overrides_for_course should only return overrides that represent actual date changes, not reverted/reset records.

Related issues

https://github.com/openedx/frontend-app-instructor-dashboard/issues/160
https://github.com/openedx/openedx-platform/issues/38393

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading get_overrides_for_block and get_overrides_for_course, then trace how they select the most recent UserDate records and calculate actual_date. Verify behavior with existing tests if present; done means reset records with no date change are excluded while active overrides remain returned.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.