Merge pull request #6806 from aignatov-bio/ai-sci-9872-fix-stock-notification-on-snapshot

Fix stock notifications on snapshots [SCI-9872]
This commit is contained in:
Martin Artnik 2023-12-12 12:43:17 +01:00 committed by GitHub
commit 442b41fafe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -203,8 +203,10 @@ class RepositoryStockValue < ApplicationRecord
end
def send_low_stock_notification
repository_row = RepositoryRow.find(repository_cell.repository_row_id)
repository = Repository.find(repository_row.repository_id)
repository_row = repository_cell.repository_row
repository = repository_row.repository
return unless repository.class.name == 'Repository'
LowStockNotification.send_notifications({
repository_row_id: repository_cell.repository_row_id,