Commits

Chris Moffitt committed 8ffc5b7

Some minor optimizations.

Comments (0)

Files changed (2)

satchmo/apps/product/models.py

             for module, subtype in active_product_types():
                 try:
                     subclass = getattr(self, subtype.lower())
-                    gettype = getattr(subclass, '_get_subtype')
-                    subtype = gettype()
-                    if not subtype in types:
-                        types.append(subtype)
+                    if subclass is not None:
+                        gettype = getattr(subclass, '_get_subtype')
+                        subtype = gettype()
+                        if not subtype in types:
+                            types.append(subtype)
                 except models.ObjectDoesNotExist:
                     pass
         except SettingNotSet:

satchmo/apps/satchmo_store/shop/templatetags/satchmo_google.py

     """
     Output the google tracker code.
     """
-    return RequestContext(context['request'],
-        {"GOOGLE_CODE": config_value('GOOGLE', 'ANALYTICS_CODE'), "secure" : secure})
+    return ({"GOOGLE_CODE": config_value('GOOGLE', 'ANALYTICS_CODE'), "secure" : secure})
 
 register.inclusion_tag("shop/google-analytics/tracker.html", takes_context=True)(show_tracker)