not allowed to delete default country

This commit is contained in:
Manuel Raynaud
2013-10-21 11:54:15 +02:00
parent a16fb0d890
commit 9ca612ae0d

View File

@@ -47,6 +47,10 @@ class Country extends BaseCountry
public function preDelete(ConnectionInterface $con = null)
{
if($this->getByDefault()) {
return false;
}
$this->dispatchEvent(TheliaEvents::BEFORE_DELETECOUNTRY, new CountryEvent($this));
return true;