Skip to content

Commit

Permalink
Bugfix AC MOA #21: the dates migration should convert special x symbo…
Browse files Browse the repository at this point in the history
…l into x letter.
  • Loading branch information
geoffroy-noel-ddh committed Aug 21, 2017
1 parent 687d7ea commit 7dc4902
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions digipal/management/commands/dpmigrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,11 @@ def move_hi_dates_to_text(self):
item_itempart.save()
print 'Created'
for text in texts.all():
text.date = hi.date
text.date = hi.date.replace(u'×', u'x')
text.date_sort = hi.date_sort
print ur'Move %s from HI #%s to Text #%s' % (hi.date, hi.id, ip.id)
print ur'Move %s from HI #%s to Text #%s' % (text.date, hi.id, ip.id)
text.save()
print dputils.get_range_from_date(text.date)
hi.date = None
hi.date_sort = None
hi.save()
Expand Down
1 change: 1 addition & 0 deletions digipal/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,7 @@ def get_range_from_date(str):

if str is not None and is_max_date_range(ret):
# circa 1221 x circa 1247
str = str.replace(u'×', u'x')
if 'x' in str:
parts = str.split('x')
if len(parts) == 2:
Expand Down

0 comments on commit 7dc4902

Please sign in to comment.