Skip to content

Commit

Permalink
DEV: Add some more verbose logging for debugging groups (#242)
Browse files Browse the repository at this point in the history
Sometimes users aren't added to groups so adding some more logging
statements to aid in debugging.
  • Loading branch information
oblakeerickson authored Oct 18, 2024
1 parent 185071a commit f40d6f9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/controllers/discourse_subscriptions/hooks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ def create

group = plan_group(item[:price])
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.save!

Expand Down

0 comments on commit f40d6f9

Please sign in to comment.