Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LITE-30249 Product exporting plugin fails with error TypeError #229

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions connect/cli/plugins/product/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ def _build_f1_options(option_list):
return '"{options}"'.format(options=','.join(option_list))


def _primary_translation_str(trans):
return f'{trans["locale"]["id"]} ({trans["locale"]["name"]})' if trans else ''


def _setup_cover_sheet(ws, product, location, client, media_path):
ws.title = 'General Information'
ws.column_dimensions['A'].width = 50
Expand Down Expand Up @@ -118,9 +122,8 @@ def _setup_cover_sheet(ws, product, location, client, media_path):
.translations.filter(context__instance_id=product['id'], primary=True)
.first()
)
ws[
'B14'
].value = f'{ primary_translation["locale"]["id"] } ({ primary_translation["locale"]["name"] })'

ws['B14'].value = _primary_translation_str(primary_translation)

categories = client.categories.all()
unassignable_cat = ['Cloud Services', 'All Categories']
Expand Down
Loading
Loading