mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-15 18:00:36 +01:00
Handle default value for new user
This commit is contained in:
parent
e4977b8a86
commit
0bd2cb1ecd
@ -37,5 +37,7 @@ parameters:
|
||||
export_mobi: true
|
||||
export_pdf: true
|
||||
|
||||
# List view
|
||||
# default user config
|
||||
items_on_page: 12
|
||||
theme: baggy
|
||||
language: en_US
|
||||
|
@ -135,11 +135,10 @@ class InstallCommand extends ContainerAwareCommand
|
||||
|
||||
$em->persist($user);
|
||||
|
||||
$config = new Config();
|
||||
$config->setUser($user);
|
||||
$config->setTheme('baggy');
|
||||
$config->setItemsPerPage(10);
|
||||
$config->setLanguage('en_US');
|
||||
$config = new Config($user);
|
||||
$config->setTheme($this->getContainer()->getParameter('theme'));
|
||||
$config->setItemsPerPage($this->getContainer()->getParameter('items_on_page'));
|
||||
$config->setLanguage($this->getContainer()->getParameter('language'));
|
||||
|
||||
$em->persist($config);
|
||||
}
|
||||
|
@ -81,6 +81,14 @@ class ConfigController extends Controller
|
||||
|
||||
if ($newUserForm->isValid()) {
|
||||
$em->persist($newUser);
|
||||
|
||||
$config = new Config($newUser);
|
||||
$config->setTheme($this->container->getParameter('theme'));
|
||||
$config->setItemsPerPage($this->container->getParameter('items_on_page'));
|
||||
$config->setLanguage($this->container->getParameter('language'));
|
||||
|
||||
$em->persist($config);
|
||||
|
||||
$em->flush();
|
||||
|
||||
$this->get('session')->getFlashBag()->add(
|
||||
|
Loading…
Reference in New Issue
Block a user