diff options
author | Nico von Geyso <Nico.Geyso@FU-Berlin.de> | 2012-08-16 02:55:44 +0200 |
---|---|---|
committer | Nico von Geyso <Nico.Geyso@FU-Berlin.de> | 2012-08-16 02:55:44 +0200 |
commit | 4ce5efbe6fe4373b80b206c2dda5881e15e50cfe (patch) | |
tree | 3d8d61b5f3a5477c6dcb9050dc893b17f0f1bfb6 | |
parent | 8666896422e3c664065b9dc63c84599d3dc98da1 (diff) | |
download | klausuren-4ce5efbe6fe4373b80b206c2dda5881e15e50cfe.tar.gz klausuren-4ce5efbe6fe4373b80b206c2dda5881e15e50cfe.tar.bz2 klausuren-4ce5efbe6fe4373b80b206c2dda5881e15e50cfe.zip |
correct order for new modules
-rw-r--r-- | app.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -70,8 +70,7 @@ def upload(study, module = None): form.module.choices = app.config['STUDIES'][study] if 'new' not in dict(form.module.choices): - if len(form.module.choices) > 0: - form.module.choices.append(('', u'---')) + form.module.choices.append(('', u'---')) form.module.choices.append(('new', u'neues Modul hinzufügen')) @@ -79,7 +78,8 @@ def upload(study, module = None): if form.module.data == 'new': module = form.module_new.data slug = module.encode('ascii', errors='ignore') - app.config['STUDIES'][study].append((slug,module)) + i = len(app.config['STUDIES'][study]) - 2 + app.config['STUDIES'][study].insert(i, (slug,module)) else: module = dict(app.config['STUDIES'][study])[form.module.data] |