Skip to content

Conversation

polypixeldev
Copy link
Member

Summary of the problem

We're not currently doing any validations on when blocks are saved, and leaving checking that any parameters are valid until we render the block. Now that blocks are in the database, we can easily use validations to not save any invalid data in the first place.

Describe your changes

Added a validation to the HCB code block that makes sure that it is in the same event as the announcement the block is a part of, and alerts it to the user with a browser alert (this will be changed to something nicer in a future PR). The existing checks in render are not removed since invalid data could still be in the database or be added with a Rails method that does not check validations.

@polypixeldev polypixeldev requested review from a team as code owners July 21, 2025 20:23
@polypixeldev polypixeldev changed the title Add validation for unauthorized HCB code block [Announcement] Add validation for unauthorized HCB code block Jul 21, 2025
Copy link
Member

@sampoder sampoder left a comment

Choose a reason for hiding this comment

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

tested locally - works! lgtm

@sampoder sampoder added this pull request to the merge queue Jul 26, 2025
Merged via the queue into main with commit e51f517 Jul 26, 2025
12 checks passed
@sampoder sampoder deleted the polypixeldev/better-block-errors branch July 26, 2025 16:38
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.

3 participants