Skip to content

Commit 3f27f22

Browse files
committed
Handle exception on migration 0002
1 parent 8c8c415 commit 3f27f22

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

migrations/0002_upgrade_materialize.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,14 @@ def find_and_handle_custom_stylesheets(apps, schema_editor, reverse=False):
8989
# logger.info('Checking custom journal stylesheets')
9090
for journal in Journal.objects.all():
9191
journal_id = journal.id
92-
theme = SettingValue.objects.get(
93-
setting__group__name='general',
94-
setting__name='journal_theme',
95-
journal__id=journal_id,
96-
)
92+
try:
93+
theme = SettingValue.objects.get(
94+
setting__group__name='general',
95+
setting__name='journal_theme',
96+
journal__id=journal_id,
97+
)
98+
except SettingValue.DoesNotExist:
99+
continue
97100
if theme.value == 'material':
98101
stylesheet_paths = [
99102
os.path.join(

0 commit comments

Comments
 (0)