From a80ba1d7bf1cf2741a67dcf4fbaa4f48d8d8ca2b Mon Sep 17 00:00:00 2001 From: Chris Done Date: Thu, 20 Nov 2014 15:30:26 +0100 Subject: [PATCH] Select distinct tags from tags page @snoyberg --- Handler/Tag.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Handler/Tag.hs b/Handler/Tag.hs index eeb8574..5b8aee0 100644 --- a/Handler/Tag.hs +++ b/Handler/Tag.hs @@ -23,7 +23,7 @@ getTagR tagSlug = do -- FIXME arguably: check if this tag is banned. Leaving it as displayed for -- now, since someone needs to go out of their way to find it. packages <- fmap (map (\(E.Value t,E.Value s) -> (t,strip s))) $ runDB $ - E.select $ E.from $ \(tag,meta) -> do + E.selectDistinct $ E.from $ \(tag,meta) -> do E.where_ (tag E.^. TagTag E.==. E.val tagSlug E.&&. meta E.^. MetadataName E.==. tag E.^. TagPackage) E.orderBy [E.asc (tag E.^. TagPackage)]