changed upload directory

This commit is contained in:
nek0 2014-08-14 03:05:02 +02:00
parent 6934ae5f88
commit 87611667a7
3 changed files with 3 additions and 2 deletions

1
.gitignore vendored
View file

@ -12,3 +12,4 @@ yesod-devel/
cabal.sandbox.config cabal.sandbox.config
.DS_Store .DS_Store
*.swp *.swp
data*

View file

@ -14,6 +14,6 @@ getActivateR token = do
redirect $ HomeR redirect $ HomeR
Just x -> do Just x -> do
userId <- runDB $ insert $ tokenUser (entityVal x) userId <- runDB $ insert $ tokenUser (entityVal x)
liftIO $ createDirectory $ "static" </> (unpack $ extractKey userId) liftIO $ createDirectory $ "data" </> (unpack $ extractKey userId)
setMessage $ [shamlet|<pre>User activated|] setMessage $ [shamlet|<pre>User activated|]
redirect $ HomeR redirect $ HomeR

View file

@ -28,7 +28,7 @@ postNewAlbumR = do
case result of case result of
FormSuccess album -> do FormSuccess album -> do
albumId <- runDB $ insert album albumId <- runDB $ insert album
liftIO $ createDirectory $ "static" </> (unpack $ extractKey $ Key userId) </> (unpack $ extractKey albumId) liftIO $ createDirectory $ "data" </> (unpack $ extractKey $ Key userId) </> (unpack $ extractKey albumId)
setMessage $ [shamlet|<pre>Album successfully created|] setMessage $ [shamlet|<pre>Album successfully created|]
redirect $ ProfileR $ Key userId redirect $ ProfileR $ Key userId