Only send notifications on new news by default

This commit is contained in:
Igor Scheller 2023-12-27 15:48:57 +01:00 committed by msquare
parent 3c0cbe55b6
commit b229d697a3
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ class NewsController extends BaseController
$news = $this->news->find($newsId); $news = $this->news->find($newsId);
$isMeeting = (bool) $request->get('meeting', false); $isMeeting = (bool) $request->get('meeting', false);
return $this->showEdit($news, true, $isMeeting); return $this->showEdit($news, !$news, $isMeeting);
} }
protected function showEdit(?News $news, bool $sendNotification = true, bool $isMeetingDefault = false): Response protected function showEdit(?News $news, bool $sendNotification = true, bool $isMeetingDefault = false): Response

View File

@ -44,7 +44,7 @@ class NewsControllerTest extends ControllerTest
$this->assertEquals('pages/news/edit.twig', $view); $this->assertEquals('pages/news/edit.twig', $view);
$this->assertNotEmpty($data['news']); $this->assertNotEmpty($data['news']);
$this->assertTrue($data['send_notification']); $this->assertFalse($data['send_notification']);
return $this->response; return $this->response;
}); });