Skip to content

Commit

Permalink
Fixed #6301: Do not allow duplicate asset tags (#6324)
Browse files Browse the repository at this point in the history
* Fixed #6301: Do not allow duplicate asset tags

* Display error message for single asset_tag failure
  • Loading branch information
svpernova09 authored and snipe committed Oct 12, 2018
1 parent b8f8d49 commit 704209d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/Assets/AssetsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ public function store(ImageUploadRequest $request)
}
}

// Was the asset created?
if ($asset->save()) {
// Validate the asset before saving
if ($asset->isValid() && $asset->save()) {

if (request('assigned_user')) {
$target = User::find(request('assigned_user'));
Expand Down
1 change: 1 addition & 0 deletions resources/views/hardware/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
</div>
@endif
{!! $errors->first('asset_tags', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
{!! $errors->first('asset_tag', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
</div>
@include ('partials.forms.edit.serial', ['fieldname'=> 'serials[1]', 'translated_serial' => trans('admin/hardware/form.serial')])

Expand Down

0 comments on commit 704209d

Please sign in to comment.