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

Capitalized Settings sheet in XLSForm causes 500 error on deployment #2126

Closed
jnm opened this issue Dec 14, 2018 · 2 comments
Closed

Capitalized Settings sheet in XLSForm causes 500 error on deployment #2126

jnm opened this issue Dec 14, 2018 · 2 comments
Assignees
Labels
bug Things broken and not working as expected

Comments

@jnm
Copy link
Member

jnm commented Dec 14, 2018

I guess the sheet name should be lowercased on import? Maybe that should be done for survey and choices as well? Other sheets not specified by the XLSForm standard should probably be left alone.

Discussion: https://www.flowdock.com/app/kobotoolbox/support/threads/qmma62iaW9Fa5XdhOdia_aBpU5V

Demonstration form:
Settings.xlsx

Exception:

Exception: asset.content improperly formatted for XLS export: Exception("duplicate worksheet name u'Settings'",)
  File "django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "rest_framework/viewsets.py", line 87, in view
    return self.dispatch(request, *args, **kwargs)
  File "rest_framework/views.py", line 466, in dispatch
    response = self.handle_exception(exc)
  File "rest_framework/views.py", line 463, in dispatch
    response = handler(request, *args, **kwargs)
  File "kpi/views.py", line 1193, in deployment
    serializer.save()
  File "rest_framework/serializers.py", line 191, in save
    self.instance = self.create(validated_data)
  File "kpi/serializers.py", line 751, in create
    active=validated_data.get('active', False))
  File "kpi/deployment_backends/mixin.py", line 39, in deploy
    self.connect_deployment(backend=backend, active=active)
  File "kpi/deployment_backends/mixin.py", line 27, in connect_deployment
    DEPLOYMENT_BACKENDS[backend](self).connect(**kwargs)
  File "kpi/deployment_backends/kobocat_backend.py", line 272, in connect
    'form_title': self.asset.name,
  File "kpi/models/asset.py", line 413, in to_xls_io
    sys.exc_info()[2]
  File "kpi/models/asset.py", line 406, in to_xls_io
    cur_sheet = workbook.add_sheet(sheet_name)
  File "xlwt/Workbook.py", line 371, in add_sheet
    raise Exception("duplicate worksheet name %r" % sheetname)
@jnm jnm added the bug Things broken and not working as expected label Dec 14, 2018
@noliveleger
Copy link
Contributor

This issue seems to be resolved with FormPack Pyxform update with this kobotoolbox/formpack#188

@jnm please close this issue when the update is released on production servers.

@noliveleger noliveleger assigned jnm and unassigned noliveleger Jan 8, 2019
@joshuaberetta
Copy link
Member

No longer throws an exception, but the capitalized sheet names are just ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Things broken and not working as expected
Projects
None yet
Development

No branches or pull requests

3 participants