Skip to content

Add missing validations to the Hold model - #1520

Merged
jazairi merged 2 commits into
mainfrom
etd-691
Jul 30, 2026
Merged

jazairi merged 2 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

@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.252% (+0.002%) from 98.25% — 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
@jazairi
jazairi temporarily deployed to thesis-submit-pr-1520 July 29, 2026 17:44 Inactive

@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.

I think this got a bonus commit added?

jazairi added 2 commits July 30, 2026 08:10
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.
@jazairi
jazairi temporarily deployed to thesis-submit-pr-1520 July 30, 2026 15:10 Inactive
@jazairi

jazairi commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

@JPrevost Sorry about that -- I was working with a bunch of different branches yesterday, and something must have gotten muddled. I just dropped the extra commit.

@jazairi
jazairi requested a review from JPrevost July 30, 2026 15:12
@jazairi
jazairi merged commit 532b5a9 into main Jul 30, 2026
2 checks passed
@jazairi
jazairi deleted the etd-691 branch July 30, 2026 15:50
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