Fix missing ifthenpaylink bug

If you added a member and they clicked on the payment link within 5
minutes, there was a possibility that the ifthenpay link hadn't been
generated yet.

This fixes that bug by generating the ifthenpay links on member
creation.
This commit is contained in:
Hugo Peixoto 2023-09-20 14:20:18 +01:00
parent dcc6d1a991
commit d6bd26c76f

View File

@ -28,6 +28,7 @@ class MembersController < ApplicationController
@member = Member.new(member_params.merge(number: (Member.maximum(:number) || 0) + 1)) @member = Member.new(member_params.merge(number: (Member.maximum(:number) || 0) + 1))
if @member.save if @member.save
@member.generate_missing_ifthenpay_links!
@member.reset_status! @member.reset_status!
NotificationMailer.with(member: @member).registration.deliver_now! NotificationMailer.with(member: @member).registration.deliver_now!