mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-14 04:04:03 +00:00
improve flash error collection
improve views
This commit is contained in:
parent
6bd2e5e335
commit
261d7dd0de
4 changed files with 15 additions and 19 deletions
|
|
@ -23,6 +23,7 @@ class PaymentsController < ApplicationController
|
|||
else
|
||||
@total_amount_to_pay = Ticket.total_price(@conference, current_user, paid: false)
|
||||
@unpaid_ticket_purchases = current_user.ticket_purchases.unpaid.by_conference(@conference)
|
||||
flash[:error] = @payment.errors.full_messages.to_sentence + ' Please try again with correct credentials.'
|
||||
render :new
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ class TicketPurchasesController < ApplicationController
|
|||
authorize_resource :conference_registrations, class: Registration
|
||||
|
||||
def create
|
||||
TicketPurchase.by_conference(@conference).unpaid.by_user(current_user).destroy_all
|
||||
current_user.ticket_purchases.by_conference(@conference).unpaid.destroy_all
|
||||
message = TicketPurchase.purchase(@conference, current_user, params[:tickets][0])
|
||||
if message.blank?
|
||||
if current_user.ticket_purchases.by_conference(@conference).unpaid.any?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue