mirror of
https://github.com/wallabag/wallabag.git
synced 2024-06-25 00:20:34 +00:00
Create config even if user is disabled
When a user register itself AND the wallabag instance is configured to send a confirmation email, the user is disabled when the listener (which create the config) receive the event. There were a check (don't know why) if the user is enabled we create the config. But the user is disabled when confirmation email is actived.
This commit is contained in:
parent
f0b2d57154
commit
755ff9e835
|
@ -45,10 +45,6 @@ class CreateConfigListener implements EventSubscriberInterface
|
||||||
|
|
||||||
public function createConfig(UserEvent $event, $eventName = null, EventDispatcherInterface $eventDispatcher = null)
|
public function createConfig(UserEvent $event, $eventName = null, EventDispatcherInterface $eventDispatcher = null)
|
||||||
{
|
{
|
||||||
if (!$event->getUser()->isEnabled()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$config = new Config($event->getUser());
|
$config = new Config($event->getUser());
|
||||||
$config->setTheme($this->theme);
|
$config->setTheme($this->theme);
|
||||||
$config->setItemsPerPage($this->itemsOnPage);
|
$config->setItemsPerPage($this->itemsOnPage);
|
||||||
|
|
|
@ -41,26 +41,6 @@ class CreateConfigListenerTest extends \PHPUnit_Framework_TestCase
|
||||||
$this->response = Response::create();
|
$this->response = Response::create();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testWithInvalidUser()
|
|
||||||
{
|
|
||||||
$user = new User();
|
|
||||||
$user->setEnabled(false);
|
|
||||||
|
|
||||||
$event = new FilterUserResponseEvent(
|
|
||||||
$user,
|
|
||||||
$this->request,
|
|
||||||
$this->response
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->em->expects($this->never())->method('persist');
|
|
||||||
$this->em->expects($this->never())->method('flush');
|
|
||||||
|
|
||||||
$this->dispatcher->dispatch(
|
|
||||||
FOSUserEvents::REGISTRATION_COMPLETED,
|
|
||||||
$event
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testWithValidUser()
|
public function testWithValidUser()
|
||||||
{
|
{
|
||||||
$user = new User();
|
$user = new User();
|
||||||
|
|
Loading…
Reference in a new issue