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 :: Text -> Handler Html
getUserR ownerName = do getUserR ownerName = do
tempOwner <- runDB $ selectFirst [UserName ==. ownerName] [] tempOwner <- runDB $ getBy $ UniqueUser ownerName
case tempOwner of case tempOwner of
Just (Entity ownerId _) -> Just (Entity ownerId _) ->
getProfileR ownerId getProfileR ownerId

View file

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