mirror of
https://github.com/snipe/snipe-it.git
synced 2026-03-16 21:46:07 +00: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:
@ -116,16 +116,14 @@ class GroupsController extends Controller
|
||||
$group->permissions = json_encode(Input::get('permission'));
|
||||
|
||||
|
||||
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 {
|
||||
if (config('app.lock_passwords')) {
|
||||
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());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user