From 05cbd31b2be98eaa275d7826085ace908f16c924 Mon Sep 17 00:00:00 2001
From: Jakub Trzaskoma <jakub.piotr.trzaskoma@cern.ch>
Date: Mon, 7 Jan 2013 14:02:53 +0100
Subject: [PATCH] [FIX] Managers can modify event payment settings
* Event managers can modify CERNEPayment setting
* Apply Fees enabled by default
* Closes #929
---
.../indico/ext/epayment/cern/epayment.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/plugins/epayment/CERNYellowPay/indico/ext/epayment/cern/epayment.py b/plugins/epayment/CERNYellowPay/indico/ext/epayment/cern/epayment.py
index 77820ec..3b09a45 100644
a
|
b
|
class CERNYellowPayMod(BaseEPayMod): |
41 | 41 | self._enabled = False |
42 | 42 | self._title = "CERN Epayment" |
43 | 43 | self._paymentMethodList = {} |
44 | | self._applyFee = False |
| 44 | self._applyFee = True |
45 | 45 | |
46 | 46 | def getId(self): |
47 | 47 | return MODULE_ID |
… |
… |
class CERNYellowPayMod(BaseEPayMod): |
61 | 61 | def getHashSeed(self): |
62 | 62 | return PluginsHolder().getPluginType("EPayment").getPlugin(MODULE_ID).getOption("hashSeed").getValue() |
63 | 63 | |
64 | | def getPluginSectionHTML(self, conf, user, urlStatus, urlModif, img, text): |
65 | | # CERN Plugin: Just admins can see and modify it |
| 64 | def getPluginSectionHTML(self, conf, avatar, urlStatus, urlModif, img, text): |
| 65 | # CERN Plugin: Just admins and event managers can see and modify it |
66 | 66 | |
67 | 67 | minfo = HelperMaKaCInfo.getMaKaCInfoInstance() |
68 | 68 | al = minfo.getAdminList() |
69 | 69 | |
70 | 70 | html = "" |
71 | 71 | |
72 | | if al.isAdmin(user): |
73 | | html = super(CERNYellowPayMod, self).getPluginSectionHTML(conf, user, urlStatus, urlModif, img, text) |
| 72 | if al.isAdmin(avatar.getUser()) or conf.canModify(avatar): |
| 73 | html = super(CERNYellowPayMod, self).getPluginSectionHTML(conf, avatar, urlStatus, urlModif, img, text) |
74 | 74 | else: |
75 | 75 | from MaKaC.plugins.base import PluginsHolder |
76 | 76 | endis = "enable" |
… |
… |
class CERNYellowPayMod(BaseEPayMod): |
197 | 197 | |
198 | 198 | def getApplyFee(self): |
199 | 199 | if not hasattr(self,"_applyFee"): |
200 | | self._applyFee = False |
| 200 | self._applyFee = True |
201 | 201 | return self._applyFee |
202 | 202 | |
203 | 203 | def setApplyFee(self, applyFee): |