1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-30 19:52:20 +01:00

(bug) list supporting documents types for a deleted group

This commit is contained in:
Sylvain 2023-04-05 09:59:22 +02:00
parent 758827f231
commit 6b98f21300
2 changed files with 4 additions and 1 deletions

View File

@ -3,6 +3,7 @@
- Italian language support (credits to https://crowdin.com/profile/olazzari) - Italian language support (credits to https://crowdin.com/profile/olazzari)
- Improved error message on payzen misconfigured currency - Improved error message on payzen misconfigured currency
- Improved reporting error messages in UI, from ruby exceptions - Improved reporting error messages in UI, from ruby exceptions
- Fix a bug: unable to list supporting documents types for a deleted group
- Fix a bug: notification is broken when updating payzen currency - Fix a bug: notification is broken when updating payzen currency
- Fix a bug: broken admin notifications if an order has been paid - Fix a bug: broken admin notifications if an order has been paid
- Fix a bug: unable to bulk update settings - Fix a bug: unable to bulk update settings

View File

@ -4,7 +4,9 @@
class SupportingDocumentTypeService class SupportingDocumentTypeService
def self.list(filters = {}) def self.list(filters = {})
if filters[:group_id].present? if filters[:group_id].present?
group = Group.find(filters[:group_id]) group = Group.find_by(id: filters[:group_id])
return nil if group.nil?
group.supporting_document_types.includes(:groups) group.supporting_document_types.includes(:groups)
else else
SupportingDocumentType.all SupportingDocumentType.all