Skip to content

Commit

Permalink
Add basic revision_type assertion to PageRevisionService as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
emmiegit committed Oct 10, 2024
1 parent 9224471 commit 2eea733
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions deepwell/src/services/page_revision/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,18 @@ impl PageRevisionService {
let txn = ctx.transaction();
let revision_number = next_revision_number(&previous, site_id, page_id);

// Replace with debug_assert_matches! when stablized
debug_assert!(
matches!(
revision_type,
PageRevisionType::Regular
| PageRevisionType::Move
| PageRevisionType::Rollback
| PageRevisionType::Undo,
),
"Invalid revision type for standard revision creation",
);

// Fields to create in the revision
let mut parser_errors = None;
let mut old_slug = None;
Expand Down

0 comments on commit 2eea733

Please sign in to comment.