(self, request=None, quantity=None)
Modify an existing user subscription
Modify an existing user subscription
Modify an existing user subscription
def adjust(self, request=None, quantity=None):
        ''' Modify an existing user subscription '''
        if request:
            form_data = self.parse_form(request)
            if form_data['type'] is "adjust":
                if form_data['quantity'] >= self.user.monitorCount:
                    result = self.modify_subscription(form_data)
                    if result:
                        self.user.subplans = form_data['quantity']
                        result = self.user.setSubscription(self.rdb)
                        return result
                    else:
                        return False
                else:
                    return False
            else:
                return False
        elif quantity:
            form_data = {'quantity' : quantity}
            result = self.modify_subscription(form_data)
            if result:
                self.user.subplans = form_data['quantity']
                result = self.user.setSubscription(self.rdb)
                return result
            else:
                return False
        else:
            return False
def adjust ( self , request = None , quantity = None ) : if request : form_data = self . parse_form ( request ) if form_data [ 'type' ] is "adjust" : if form_data [ 'quantity' ] >= self . user . monitorCount : result = self . modify_subscription ( form_data ) if result : self . user . subplans = form_data [ 'quantity' ] result = self . user . setSubscription ( self . rdb ) return result else : return False else : return False else : return False elif quantity : form_data = { 'quantity' : quantity } result = self . modify_subscription ( form_data ) if result : self . user . subplans = form_data [ 'quantity' ] result = self . user . setSubscription ( self . rdb ) return result else : return False else : return False