Skip to content

Commit

Permalink
Fixes #13341 Clean up correct seats on license delete
Browse files Browse the repository at this point in the history
Before this, we checked for the `id` collumn in the `license_seats` table, insteasd of
using `license_id` for this.

This way, we ensure that we only alter seats belonging to the correct license.
  • Loading branch information
Tobias Franzius committed Jul 20, 2023
1 parent a19a508 commit 90a344a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Licenses/LicensesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public function destroy($licenseId)
if ($license->assigned_seats_count == 0) {
// Delete the license and the associated license seats
DB::table('license_seats')
->where('id', $license->id)
->where('license_id', $license->id)
->update(['assigned_to' => null, 'asset_id' => null]);

$licenseSeats = $license->licenseseats();
Expand Down

0 comments on commit 90a344a

Please sign in to comment.