Show error if STATUS isn't one of the accepted values

This commit is contained in:
Tom Willemse 2023-12-07 22:27:24 -08:00
parent cf761c40a5
commit 087165a993

View file

@ -65,6 +65,12 @@ with a /.")
(list "COMMENTS-CLOSED-DATE"
(and (not (string-empty-p date))
(tekuti--format-date date))))
(`("STATUS" ,status)
(let ((accepted-values '("publish" "draft" "private")))
(if (member status accepted-values)
pair
(error "Unknown post status: %s; Accepted values are: %s"
status accepted-values))))
(_ pair)))
(defun tekuti-build-data-from-org ()