]> git.ipfire.org Git - people/shoehn/ipfire.org.git/commitdiff
fireinfo: Fix creating images for half-empty profiles
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 19 Mar 2015 16:12:45 +0000 (17:12 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 19 Mar 2015 16:12:45 +0000 (17:12 +0100)
webapp/backend/fireinfo.py
webapp/backend/iuse.py

index 4aab91e71e4ae9950da8f026127727d73c31a1c4..c6144088fea965915bfaff0c8483214f1b3ef1d2 100644 (file)
@@ -797,7 +797,7 @@ class Profile(Object):
 
        @property
        def friendly_memory(self):
-               return util.format_size(self.memory)
+               return util.format_size(self.memory or 0)
 
        # Storage
 
index 5faadcc96cb3c94b1dfd23d5d03da8eb5dd4d59a..0da525aa91a2ba66e232dcdc20c608d030d0e046 100644 (file)
@@ -163,7 +163,9 @@ class Image1(ImageObject):
 
                # Otherwise show some general hardware information of the machine
                else:
-                       line2.append(self.profile.processor.friendly_string)
+                       if self.profile.processor:
+                               line2.append(self.profile.processor.friendly_string)
+
                        line2.append(self.profile.friendly_memory)
 
                self.draw_text((225, 9), " | ".join(line1))