Subversion Repositories SmartDukaan

Rev

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

Rev 4501 Rev 4506
Line 1027... Line 1027...
1027
        order.doa_auth_timestamp = datetime.datetime.now()
1027
        order.doa_auth_timestamp = datetime.datetime.now()
1028
        session.commit()
1028
        session.commit()
1029
        return True
1029
        return True
1030
    except Exception as e:
1030
    except Exception as e:
1031
        print sys.exc_info()
1031
        print sys.exc_info()
1032
	traceback.print_tb(sys.exc_info()[2])
1032
        traceback.print_tb(sys.exc_info()[2])
1033
        return False
1033
        return False
1034
    finally:
1034
    finally:
1035
        if os.path.exists(filename):
1035
        if os.path.exists(filename):
1036
            os.remove(filename)
1036
            os.remove(filename)
1037
 
1037
 
Line 2035... Line 2035...
2035
    if not order:
2035
    if not order:
2036
        raise TransactionServiceException(108, "no such order")
2036
        raise TransactionServiceException(108, "no such order")
2037
    
2037
    
2038
    return order
2038
    return order
2039
 
2039
 
-
 
2040
def get_orders_for_provider_for_status(provider_id, order_status):
-
 
2041
    if not provider_id or not order_status:
-
 
2042
        raise TransactionServiceException(101, "bad provider id or order status")
-
 
2043
    query = Order.query.filter_by(logistics_provider_id = provider_id, status = order_status)
-
 
2044
    return query.all()
2040
 
2045
 
2041
def close_session():
2046
def close_session():
2042
    if session.is_active:
2047
    if session.is_active:
2043
        print "session is active. closing it."
2048
        print "session is active. closing it."
2044
        session.close()
2049
        session.close()