Commits

Alexander Schremmer committed 5dc016d

Fix game cloning.

Comments (0)

Files changed (2)

domination/main.py

         newname = "%s (%i)" % (name, ctr)
     if "card" in request.args:
         enabled_cards = set(request.args.getlist("card"))
-        enabled_editions = set(c.edition.name for c in CardTypeRegistry.keys2classes(request.form.getlist('card_key')))
+        enabled_editions = set(c.edition.key for c in CardTypeRegistry.keys2classes(request.args.getlist('card')))
     else:
         enabled_cards = enabled_editions = ()
     return render_template("create_game.html", editions=editions,

domination/templates/create_game.html

     <p>{% trans %}Editions:{% endtrans %}
       {% for edition in editions %}
       <input type="checkbox" name="edition" value="{{ edition.key }}"
-      {% if not edition.optional %}checked="checked" disabled="disabled"{% else %}{% if edition.name in enabled_editions %}checked="checked"{% endif %}{% endif %}>
+      {% if not edition.optional %}checked="checked" disabled="disabled"{% else %}{% if edition.key in enabled_editions %}checked="checked"{% endif %}{% endif %}>
       {{ edition.name }}
       {% endfor %}
     </p>