Subversion Repositories SmartDukaan

Rev

Rev 2432 | Rev 3031 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2432 Rev 2439
Line 199... Line 199...
199
    lineitem.total_weight = weight
199
    lineitem.total_weight = weight
200
    lineitem.unit_weight = weight
200
    lineitem.unit_weight = weight
201
    #TODO: Update the weight of item. Problem is that even then, this update will only go to Production and not to Staging. Next content update will wipe out this data.
201
    #TODO: Update the weight of item. Problem is that even then, this update will only go to Production and not to Staging. Next content update will wipe out this data.
202
    session.commit()
202
    session.commit()
203
 
203
 
204
def cancel(order_id):
204
def cancel(order):
205
    '''
205
    '''
206
    Cancel
206
    Cancel
207
    '''
207
    '''
208
    print("Your session has been closed")
208
    print("Your session has been closed")
209
    pass
209
    return
210
 
210
 
211
ACTIONS = {0: cancel,
211
ACTIONS = {0: cancel,
212
           1: order_outofstock,
212
           1: order_outofstock,
213
           2: mark_order_as_picked_up,
213
           2: mark_order_as_picked_up,
214
           3: mark_order_as_delivered,
214
           3: mark_order_as_delivered,
Line 265... Line 265...
265
        try:
265
        try:
266
            action = int(raw_action)
266
            action = int(raw_action)
267
        except ValueError:
267
        except ValueError:
268
            print("Invalid input.")
268
            print("Invalid input.")
269
            return
269
            return
270
        if action > 4:
270
        if action > max(ACTIONS.keys()):
271
            print("Invalid input.")
271
            print("Invalid input.")
272
            return
272
            return
273
        ACTIONS[action](order)
273
        ACTIONS[action](order)
274
    except TransactionServiceException as tsex:
274
    except TransactionServiceException as tsex:
275
        print tsex.message
275
        print tsex.message