Skip to content

Remove the LearningObjectDisplay model - #1548

Merged
ihalaij1 merged 1 commit into
apluslms:masterfrom
murhum1:delete-learningobject-display
Oct 9, 2026
Merged

ihalaij1 merged 1 commit into
apluslms:masterfrom
murhum1:delete-learningobject-display

Conversation

@murhum1

@murhum1 murhum1 commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Description

Removed the LearningObjectDisplay model and associated code.

Why?

Related features were unused despite the indexed DB table being written to almost every page load. Also took up a lot of DB space.

Fixes #1547

Testing

Navigated to exercise / chapter pages and verified no errors were thrown.

Did you test the changes in

  • Chrome
  • Firefox
  • This pull request cannot be tested in the browser.

@ihalaij1 ihalaij1 self-assigned this Oct 2, 2026
@ihalaij1
ihalaij1 self-requested a review October 2, 2026 05:38
@ihalaij1

ihalaij1 commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Don't these changes also remove the "Continue where you left off" feature that was added some time ago? @murhum1

EDIT: Nvm, the feature uses localStorage and works fine with these changes (I tested it).

@ihalaij1 ihalaij1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some things I found that should still be addressed:

  • Some translation strings in django.po files have no references left:
    • MODEL_NAME_LEARNING_OBJECT_DISPLAY
    • MODEL_NAME_LEARNING_OBJECT_DISPLAY_PLURAL
    • LABEL_LEARNING_OBJECT, which only old migrations still use
    • USER_LAST_VISITED -- … and PLACES_TO_START -- …, which still point at the deleted _user_last.html
  • INDEX_TYPE.LAST ("Link to last visited content") is now useless, should it be deleted from everywhere?
    • Removing the option would need a data migration for courses with index_mode=2, so it needs a decision.
  • The export.py help text (line 15) lists a results subcommand that handle() doesn't implement. This is not related to this PR, but should be fixed anyway.

@murhum1
murhum1 force-pushed the delete-learningobject-display branch from f2f84cf to 9cc360d Compare October 2, 2026 10:55
@murhum1
murhum1 requested a review from ihalaij1 October 2, 2026 11:14
@ihalaij1
ihalaij1 requested a balanced review from Copilot October 2, 2026 11:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The obsolete feature is removed consistently, with existing database values migrated safely.

Review effort: Balanced
Findings: None

What changed in this PR

Removes the unused LearningObjectDisplay tracking feature and its database storage.

Changes:

  • Removes display tracking, last-visited rendering, admin, export, and translation code.
  • Drops the obsolete model and database table.
  • Removes the LAST index mode and migrates existing instances to results mode.
File Description
lti_tool/​templates/​lti_tool/​lti_course.html Removes last-visited rendering.
locale/​fi/​LC_MESSAGES/​django.po Removes obsolete Finnish translations.
locale/​en/​LC_MESSAGES/​django.po Removes obsolete English translations.
exercise/​views.py Stops recording page displays.
exercise/​templatetags/​exercise.py Removes the user_last tag.
exercise/​templates/​exercise/​_user_last.html Deletes the obsolete partial.
exercise/​migrations/​0052_delete_learningobjectdisplay.py Drops the display model table.
exercise/​management/​commands/​export.py Removes display-view export support.
exercise/​exercise_models.py Removes the model definition.
exercise/​admin.py Removes model administration.
edit_course/​operations/​configure.py Removes the last configuration option.
course/​templates/​course/​course.html Removes the legacy index-mode branch.
course/​models.py Removes the LAST enum value.
course/​migrations/​0065_alter_courseinstance_index_mode.py Migrates legacy values and updates choices.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ihalaij1
ihalaij1 force-pushed the delete-learningobject-display branch from 9cc360d to 367e0b8 Compare October 9, 2026 07:44

@ihalaij1 ihalaij1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

@ihalaij1
ihalaij1 merged commit ea5f3cb into apluslms:master Oct 9, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Remove LearningObjectDisplay model

3 participants