Bugfixes rename upper-lowercase after testrun

This commit is contained in:
Ozzie Isaacs 2023-06-08 10:28:42 +02:00
parent bd4b7ffaba
commit 3ef34c8f15
2 changed files with 5 additions and 3 deletions

View File

@ -287,7 +287,7 @@ class Languages(Base):
self.lang_code = lang_code self.lang_code = lang_code
def get(self): def get(self):
if self.language_name: if hasattr(self, "language_name"):
return self.language_name return self.language_name
else: else:
return self.lang_code return self.lang_code

View File

@ -1319,10 +1319,12 @@ def remove_objects(db_book_object, db_session, del_elements):
def add_objects(db_book_object, db_object, db_session, db_type, add_elements): def add_objects(db_book_object, db_object, db_session, db_type, add_elements):
changed = False changed = False
if db_type == 'custom': if db_type == 'languages':
db_filter = db_object.lang_code
elif db_type == 'custom':
db_filter = db_object.value db_filter = db_object.value
else: else:
db_filter = db_object db_filter = db_object.name
for add_element in add_elements: for add_element in add_elements:
# check if an element with that name exists # check if an element with that name exists
changed = True changed = True