Fix #1108017 (RuntimeError: maximum recursion depth exceeded)

This commit is contained in:
Kovid Goyal 2013-01-29 12:12:01 +05:30
commit 015f3d48a7
2 changed files with 5 additions and 3 deletions

View File

@ -66,6 +66,7 @@ def find_categories(field_metadata):
def create_tag_class(category, fm, icon_map): def create_tag_class(category, fm, icon_map):
cat = fm[category] cat = fm[category]
dt = cat['datatype']
icon = None icon = None
label = fm.key_to_label(category) label = fm.key_to_label(category)
if icon_map: if icon_map:
@ -76,13 +77,13 @@ def create_tag_class(category, fm, icon_map):
icon = icon_map['custom:'] icon = icon_map['custom:']
icon_map[category] = icon icon_map[category] = icon
is_editable = category not in {'news', 'rating', 'languages', 'formats', is_editable = category not in {'news', 'rating', 'languages', 'formats',
'identifiers'} 'identifiers'} and dt != 'composite'
if (tweaks['categories_use_field_for_author_name'] == 'author_sort' and if (tweaks['categories_use_field_for_author_name'] == 'author_sort' and
(category == 'authors' or (category == 'authors' or
(cat['display'].get('is_names', False) and (cat['display'].get('is_names', False) and
cat['is_custom'] and cat['is_multiple'] and cat['is_custom'] and cat['is_multiple'] and
cat['datatype'] == 'text'))): dt == 'text'))):
use_sort_as_name = True use_sort_as_name = True
else: else:
use_sort_as_name = False use_sort_as_name = False

View File

@ -1932,7 +1932,8 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
use_sort_as_name = True use_sort_as_name = True
else: else:
use_sort_as_name = False use_sort_as_name = False
is_editable = category not in ['news', 'rating', 'languages'] is_editable = (category not in ['news', 'rating', 'languages'] and
datatype != "composite")
categories[category] = [tag_class(formatter(r.n), count=r.c, id=r.id, categories[category] = [tag_class(formatter(r.n), count=r.c, id=r.id,
avg=avgr(r), sort=r.s, icon=icon, avg=avgr(r), sort=r.s, icon=icon,
category=category, category=category,