added uniqueUser

This commit is contained in:
neko 2015-08-18 23:58:33 +02:00
parent 5c6ff28132
commit 4557157a4f
2 changed files with 2 additions and 1 deletions

View file

@ -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

View file

@ -22,6 +22,7 @@ User
salted ByteString
albums [AlbumId]
admin Bool
UniqueUser name
deriving Typeable Eq Show
Activator
token Text