Commit f46a1ba7 authored by Alfredo Di Napoli's avatar Alfredo Di Napoli

Fix unsound DefaultFromField (Maybe NodeNodeCategory) instance

parent a495afdd
Pipeline #7023 failed with stages
in 51 minutes and 37 seconds
......@@ -73,7 +73,8 @@ update loggedInUserId (Move sourceId targetId) = do
-> -- both are not read-only, normal move
move_db_update sourceId targetId
(False, True)
-> (:[]) <$> publish_node (SourceId sourceId) (TargetId targetId) NPP_publish_no_edits_allowed
-> do void $ publish_node (SourceId sourceId) (TargetId targetId) NPP_publish_no_edits_allowed
move_db_update sourceId targetId
(True, False)
-> -- the source is read only. If we are the owner we allow unpublishing.
-- FIXME(adn) is this check enough?
......
......@@ -76,7 +76,7 @@ instance HasDBid NodeNodeCategory where
NNC_publish <$> lookupDBid x
instance DefaultFromField SqlInt4 (Maybe NodeNodeCategory) where
defaultFromField = lookupDBid <$> fromPGSFromField
defaultFromField = (lookupDBid =<<) <$> fromPGSFromField
type NodeNode = NodeNodePoly NodeId NodeId (Maybe Double) (Maybe NodeNodeCategory)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment