mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 13:44:06 -08:00
No new feature,No bug fix, Only refactoring (#3949)
* No change in logic ! Just exchanging the if and else code blocks and negating condition. * remove unneeded else{} block * Re-indented the code
This commit is contained in:
parent
81e358a01d
commit
ed4ea7f1f4
|
@ -116,16 +116,14 @@ class GroupsController extends Controller
|
||||||
$group->permissions = json_encode(Input::get('permission'));
|
$group->permissions = json_encode(Input::get('permission'));
|
||||||
|
|
||||||
|
|
||||||
if (!config('app.lock_passwords')) {
|
if (config('app.lock_passwords')) {
|
||||||
|
|
||||||
if ($group->save()) {
|
|
||||||
return redirect()->to("admin/groups")->with('success', trans('admin/groups/message.success.update'));
|
|
||||||
}
|
|
||||||
return redirect()->back()->withInput()->withErrors($group->getErrors());
|
|
||||||
|
|
||||||
} else {
|
|
||||||
return redirect()->route('update/group', $id)->withInput()->with('error', 'Denied! Editing groups is not allowed in the demo.');
|
return redirect()->route('update/group', $id)->withInput()->with('error', 'Denied! Editing groups is not allowed in the demo.');
|
||||||
}
|
}
|
||||||
|
if ($group->save()) {
|
||||||
|
return redirect()->to("admin/groups")->with('success', trans('admin/groups/message.success.update'));
|
||||||
|
}
|
||||||
|
return redirect()->back()->withInput()->withErrors($group->getErrors());
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue