Skip to content
Snippets Groups Projects
Commit a739373a authored by Ryan Senior's avatar Ryan Senior
Browse files

Ensure the category_id special type is restored after changed

One of the tests added recently changes the special_type of
category_id. It should have save what it's original value was and
restored it after it was done instead of assuming it's previous value
was nil.
parent 0ba26fcb
No related branches found
No related tags found
No related merge requests found
......@@ -502,11 +502,12 @@
set to type/Category. This function will change that for
category_id, then invoke `F` and roll it back afterwards"
[f]
(try
(db/update! Field (id :venues :category_id) {:special_type :type/Category})
(f)
(finally
(db/update! Field (id :venues :category_id) {:special_type nil}))))
(let [original-special-type (:special_type (Field (id :venues :category_id)))]
(try
(db/update! Field (id :venues :category_id) {:special_type :type/Category})
(f)
(finally
(db/update! Field (id :venues :category_id) {:special_type original-special-type})))))
;; ## GET /api/table/:id/query_metadata
;; Ensure internal remapped dimensions and human_readable_values are returned
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment