heyyy / espa

Automatically exported from code.google.com/p/espa
0 stars 0 forks source link

Order IDs from generate_order_id are not unique #123

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The generate_order_id function in orderservice\ordering\core.py does not 
generate unique order IDs. For example, the order IDs for orders placed at 
11:00:00 and 1:10:00 match:

>>> import datetime
>>>
>>> a = datetime.datetime(2014, 4, 23, 11, 0, 0)
>>> '%s%s%s-%s%s%s'%(a.month, a.day, a.year, a.hour, a.minute, a.second)
'4232014-1100'
>>>
>>> b = datetime.datetime(2014, 4, 23, 1, 10, 0)
>>> '%s%s%s-%s%s%s'%(b.month, b.day, b.year, b.hour, b.minute, b.second)
'4232014-1100'

The above is from Python 2.7.2 on Windows. To fix the problem the month, day, 
hour, minute, and second strings should be zero padded so the order ID is of 
consistent length.

Original issue reported on code.google.com by azvol...@conservation.org on 25 Apr 2014 at 3:01

GoogleCodeExporter commented 9 years ago

Original comment by davehil...@gmail.com on 25 Apr 2014 at 4:40

GoogleCodeExporter commented 9 years ago
Milestone-2.4.0

Original comment by davehil...@gmail.com on 9 May 2014 at 6:33

GoogleCodeExporter commented 9 years ago

Original comment by davehil...@gmail.com on 9 May 2014 at 6:33

GoogleCodeExporter commented 9 years ago

Original comment by davehil...@gmail.com on 9 May 2014 at 6:33

GoogleCodeExporter commented 9 years ago
Implemented as part of 2.4.0

Original comment by davehil...@gmail.com on 23 Jun 2014 at 3:00

GoogleCodeExporter commented 9 years ago
verified

Original comment by davehil...@gmail.com on 31 Jul 2014 at 6:44