Skip to content

Commit

Permalink
use one strange trick to fix old modules with funny numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
reedstrm committed Oct 7, 2015
1 parent 684b908 commit c6996ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cnxarchive/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,9 @@ def set_version(portal_type, legacy_version, td):

elif portal_type == 'Module':
# For modules, major should be set and minor should be None
# N.B. a very few older modules had major=2 and minor zero-based. Add one for those
modified = 'MODIFY'
td['new']['major_version'] = int(legacy_minor)
td['new']['major_version'] = int(legacy_minor)+(int(legacy_major)-1)
td['new']['minor_version'] = None

return modified
Expand Down

0 comments on commit c6996ce

Please sign in to comment.