[guadec-web-regcfp/develop] fixes
- From: Patrick Uiterwijk <puiterwijk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [guadec-web-regcfp/develop] fixes
- Date: Mon, 22 Jun 2015 21:42:07 +0000 (UTC)
commit 47415562d7f6639508a5b39eab31f9598a6ee174
Author: Patrick Uiterwijk <puiterwijk redhat com>
Date: Mon Jun 22 23:41:52 2015 +0200
fixes
routes/registration.js | 8 +++++++-
views/index/index.hbs | 2 +-
2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/routes/registration.js b/routes/registration.js
index eb5ec9f..ed3c07b 100644
--- a/routes/registration.js
+++ b/routes/registration.js
@@ -206,7 +206,13 @@ router.all('/receipt', utils.require_permission('registration/request_receipt'))
router.get('/receipt', function(req, res, next) {
req.user.getRegistration({include: [RegistrationPayment]})
.complete(function(err, reg) {
- res.render('registration/receipt', { registration: reg , layout:false });
+ if(!!err) {
+ res.status(500).send('Error retrieving your registration');
+ } else if(reg.paid < config.registration.min_amount_for_receipt) {
+ res.status(401).send('Not enough paid for receipt');
+ } else {
+ res.render('registration/receipt', { registration: reg , layout:false });
+ }
});
});
diff --git a/views/index/index.hbs b/views/index/index.hbs
index 24fc5ee..4b7e970 100644
--- a/views/index/index.hbs
+++ b/views/index/index.hbs
@@ -37,7 +37,7 @@ Hello, please login, or choose an option below.
<h3>Registration ID: {{registration.display_id}}</h3>
<div class="button"><a href="/registration/register">Update registration</a></div><br/>
{{#ifGTE registration.paid config.registration.min_amount_for_receipt}}
-<div class="button"><a href="/registration/receipt">Get receipt</a></div>
+<div class="button"><a href="/registration/receipt" target="_blank">Get receipt</a></div>
{{else}}
Not enough paid for receipt (Paid {{config.registration.currency_symbol}}{{registration.paid}}, outstanding
for onsite payment: {{config.registration.currency_symbol}}{{registration.outstanding_onsite}}, PayPal
outstanding: {{config.registration.currency_symbol}}{{registration.outstanding_paypal}})<br/>
{{/ifGTE}}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]