This is a snapshot of Indico's old Trac site. Any information contained herein is most probably outdated. Access our new GitHub site here.

Ticket #929: 0001-FIX-Managers-can-modify-event-payment-settings.patch

File 0001-FIX-Managers-can-modify-event-payment-settings.patch, 2.3 KB (added by jatrzask, 3 years ago)

Patch that should be applied to cds-indico-cern-resources

  • plugins/epayment/CERNYellowPay/indico/ext/epayment/cern/epayment.py

    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): 
    4141        self._enabled = False 
    4242        self._title = "CERN Epayment" 
    4343        self._paymentMethodList = {} 
    44         self._applyFee = False 
     44        self._applyFee = True 
    4545 
    4646    def getId(self): 
    4747        return MODULE_ID 
    class CERNYellowPayMod(BaseEPayMod): 
    6161    def getHashSeed(self): 
    6262        return PluginsHolder().getPluginType("EPayment").getPlugin(MODULE_ID).getOption("hashSeed").getValue() 
    6363 
    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 
    6666 
    6767        minfo = HelperMaKaCInfo.getMaKaCInfoInstance() 
    6868        al = minfo.getAdminList() 
    6969 
    7070        html = "" 
    7171 
    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) 
    7474        else: 
    7575            from MaKaC.plugins.base import PluginsHolder 
    7676            endis = "enable" 
    class CERNYellowPayMod(BaseEPayMod): 
    197197 
    198198    def getApplyFee(self): 
    199199        if not hasattr(self,"_applyFee"): 
    200             self._applyFee = False 
     200            self._applyFee = True 
    201201        return self._applyFee 
    202202 
    203203    def setApplyFee(self, applyFee):