Skip to content

Add missing validations to the Hold model - #1520

Open
jazairi wants to merge 3 commits into
mainfrom
etd-691
Open

Add missing validations to the Hold model#1520
jazairi wants to merge 3 commits into
mainfrom
etd-691

Conversation

@jazairi

@jazairi jazairi commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Why these changes are being introduced:

Thesis and Hold Source are required fields on the
Hold model. This is defined in the db schema, but
not at the model layer.

Because administrate checks model validations to
identify required fields, this means that these
fields don't appear as required in the admin
forms.

Relevant ticket(s):

How this addresses that need:

This adds validations for Thesis and Hold Source
to the Hold model.

Side effects of this change:

None.

Developer

  • All new ENV is documented in README
  • All new ENV has been added to Heroku Pipeline, Staging and Prod
  • ANDI or Wave has been run in accordance to
    our guide and
    all issues introduced by these changes have been resolved or opened as new
    issues (link to those issues in the Pull Request details above)
  • Stakeholder approval has been confirmed (or is not needed)

Code Reviewer

  • The commit message is clear and follows our guidelines
    (not just this pull request message)
  • There are appropriate tests covering any new functionality
  • The documentation has been updated or is unnecessary
  • The changes have been verified
  • New dependencies are appropriate or there were no changes

Requires database migrations?

NO

Includes new or updated dependencies?

NO

Why these changes are being introduced:

Thesis and Hold Source are required fields on the
Hold model. This is defined in the db schema, but
not at the model layer.

Because administrate checks model validations to
identify required fields, this means that these
fields don't appear as required in the admin
forms.

Relevant ticket(s):

- [ETD-691](https://mitlibraries.atlassian.net/browse/ETD-691)

How this addresses that need:

This adds validations for Thesis and Hold Source
to the Hold model.

Side effects of this change:

None.
@mitlib
mitlib temporarily deployed to thesis-submit-pr-1520 July 29, 2026 16:08 Inactive
@coveralls

coveralls commented Jul 29, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 98.25%. remained the same — etd-691 into main

@JPrevost JPrevost left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would you mind adding tests around a hold being invalid without a hold_source and without a thesis? I'm thinking mostly in case someone changes this in the future those tests should fail.

@jazairi
jazairi requested a review from JPrevost July 29, 2026 17:21
@jazairi
jazairi temporarily deployed to thesis-submit-pr-1520 July 29, 2026 17:21 Inactive
Why these changes are being introduced:

The report summary table is extremely inefficient
and probably not very useful.

Relevant ticket(s):

- [ETD-623](https://mitlibraries.atlassian.net/browse/ETD-623)

How this addresses that need:

This removes the summary table, so the report
index view just lists links to the individual
reports.

Side effects of this change:

- Link sidebar has been removed from the
dashboard, as it is now redundant.
- The report dashboard is now a visual design
abomination, but that feels better than a million
N+1 queries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants