diff --git a/Handler/Profile.hs b/Handler/Profile.hs index 3372248..35dd03c 100644 --- a/Handler/Profile.hs +++ b/Handler/Profile.hs @@ -52,7 +52,7 @@ getProfileR ownerId = do getUserR :: Text -> Handler Html getUserR ownerName = do - tempOwner <- runDB $ selectFirst [UserName ==. ownerName] [] + tempOwner <- runDB $ getBy $ UniqueUser ownerName case tempOwner of Just (Entity ownerId _) -> getProfileR ownerId diff --git a/config/models b/config/models index 2786cbf..2621798 100644 --- a/config/models +++ b/config/models @@ -22,6 +22,7 @@ User salted ByteString albums [AlbumId] admin Bool + UniqueUser name deriving Typeable Eq Show Activator token Text