summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNico von Geyso <Nico.Geyso@FU-Berlin.de>2012-08-16 02:55:44 +0200
committerNico von Geyso <Nico.Geyso@FU-Berlin.de>2012-08-16 02:55:44 +0200
commit4ce5efbe6fe4373b80b206c2dda5881e15e50cfe (patch)
tree3d8d61b5f3a5477c6dcb9050dc893b17f0f1bfb6
parent8666896422e3c664065b9dc63c84599d3dc98da1 (diff)
downloadklausuren-4ce5efbe6fe4373b80b206c2dda5881e15e50cfe.tar.gz
klausuren-4ce5efbe6fe4373b80b206c2dda5881e15e50cfe.tar.bz2
klausuren-4ce5efbe6fe4373b80b206c2dda5881e15e50cfe.zip
correct order for new modules
-rw-r--r--app.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/app.py b/app.py
index 9143fe1..304b843 100644
--- a/app.py
+++ b/app.py
@@ -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]