]> git.ipfire.org Git - people/jschlag/pbs.git/commitdiff
arches: Let distro editor to use new arches
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 10 Oct 2017 12:50:40 +0000 (13:50 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 10 Oct 2017 12:50:40 +0000 (13:50 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/templates/distro-edit.html
src/web/handlers_distro.py

index 58f6fd120bf385f6e805f0e7b42a738234b08232..2f33133713392fdb95926953eaa7de2aacf03759 100644 (file)
@@ -67,7 +67,7 @@
                                <td class="col2">
                                        <select name="arches" size="4" multiple>
                                                {% for arch in arches %}
-                                                       <option value="{{ arch.id }}" {% if arch in distro.arches %}selected="selected"{% end %}>{{ arch.name }}</option>
+                                                       <option value="{{ arch }}" {% if arch in distro.arches %}selected{% end %}>{{ arch }}</option>
                                                {% end %}
                                        </select>
                                </td>
index 1d1314cd50f201627abcbe5488e59aebb301c108..8b8148779e3030c25afbfc22f83e797e5fe9a0f5 100644 (file)
@@ -27,7 +27,7 @@ class DistributionEditHandler(BaseHandler):
                        raise tornado.web.HTTPError(404, "Distro not found")
 
                self.render("distro-edit.html", distro=distro,
-                       arches=self.arches.get_all(), sources=self.sources)
+                       arches=self.backend.arches, sources=self.sources)
 
        @tornado.web.authenticated
        def post(self, name):
@@ -54,15 +54,10 @@ class DistributionEditHandler(BaseHandler):
                # Update architectures.
                arches = []
                for arch in self.get_arguments("arches", []):
-                       try:
-                               arch_id = int(arch)
-                       except ValueError:
+                       # Check if arch exists
+                       if not self.backend.arches.exists(arch):
                                continue
 
-                       if not self.arches.exists(arch_id):
-                               continue
-
-                       arch = self.arches.get_by_id(arch_id)
                        arches.append(arch)
 
                distro.arches = arches