Small optimizations.

This commit is contained in:
James Cole
2015-01-17 10:05:43 +01:00
parent 027b954b50
commit fc0ef4b79d
9 changed files with 30 additions and 8 deletions

View File

@@ -122,6 +122,8 @@ class CurrencyController extends BaseController
}
/**
* @SuppressWarnings("CyclomaticComplexity") // It's exactly 5. So I don't mind.
*
* @return $this|\Illuminate\Http\RedirectResponse
*/
public function store()
@@ -173,10 +175,11 @@ class CurrencyController extends BaseController
Session::flash('errors', $messages['errors']);
if ($messages['errors']->count() > 0) {
Session::flash('error', 'Could not update currency: ' . $messages['errors']->first());
return Redirect::route('currency.edit', $currency->id)->withInput();
}
// return to update screen:
if ($data['post_submit_action'] == 'validate_only' || $messages['errors']->count() > 0) {
if ($data['post_submit_action'] == 'validate_only') {
return Redirect::route('currency.edit', $currency->id)->withInput();
}