DEV: Add some more verbose logging for debugging groups (#242)

Sometimes users aren't added to groups so adding some more logging
statements to aid in debugging.
This commit is contained in:
Blake Erickson 2024-10-18 14:29:42 -06:00 committed by GitHub
parent 185071aa03
commit f40d6f9cad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 0 deletions

View File

@ -68,6 +68,16 @@ module DiscourseSubscriptions
group = plan_group(item[:price]) group = plan_group(item[:price])
group.add(user) unless group.nil? group.add(user) unless group.nil?
if SiteSetting.discourse_subscriptions_enable_verbose_logging
Rails.logger.warn("Line item with group name meta data: #{item[:price]}")
if group.nil?
Rails.logger.warn("Group not found or not listed in metadata!")
else
Rails.logger.warn("Group: #{group.name}")
end
end
discourse_customer.product_id = item[:price][:product] discourse_customer.product_id = item[:price][:product]
discourse_customer.save! discourse_customer.save!