From c6996ce5e6e7ad392272b997160e349b4dbd76bd Mon Sep 17 00:00:00 2001 From: Ross Reedstrom Date: Wed, 7 Oct 2015 13:52:06 -0500 Subject: [PATCH] use one strange trick to fix old modules with funny numbers --- cnxarchive/database.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cnxarchive/database.py b/cnxarchive/database.py index 0ee3b566..40f719e1 100644 --- a/cnxarchive/database.py +++ b/cnxarchive/database.py @@ -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