View difference between Paste ID: Lqjz7cYF and LkFftzZa
SHOW: | | - or go back to the newest paste.
1
	public function taskFormSubmitted(Form $form)
2
	{
3
		$hash = $this->calculateHash($form->values->password) ;
4
5
		try {
6
			$this->registrations->registrationUser($form->values->username, $hash, $form->values->name);
7
			$this->flashMessage('byl jste registrovan', 'success');      
8
9
		} catch (Exception $e) {
10
			if ($e->getCode() == 23000) {
11-
				$this->flashMessage('tenhle nick uz je pouzivan.', 'success');
11+
				$this->flashMessage('tenhle nick uz je pouzivan.', 'danger');
12
13-
				$this->flashMessage('registrace se nepovedla, zkuste to prosím za chviličku znovu', 'success');
13+
14
				$this->flashMessage('registrace se nepovedla, zkuste to prosím za chviličku znovu', 'danger');
15
			}
16
		};
17
	}