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

Clicking "Export to CSV" gives me Server Error (500) #3266

Closed
arthuredelstein opened this issue Aug 20, 2020 · 1 comment
Closed

Clicking "Export to CSV" gives me Server Error (500) #3266

arthuredelstein opened this issue Aug 20, 2020 · 1 comment
Assignees

Comments

@arthuredelstein
Copy link

No description provided.

@tiftran tiftran self-assigned this Aug 20, 2020
@tiftran
Copy link
Contributor

tiftran commented Aug 20, 2020

Sentry Logs:

TypeError: unsupported operand type(s) for -: 'NoneType' and 'datetime.date'
  File "django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "rest_framework/views.py", line 505, in dispatch
    response = self.handle_exception(exc)
  File "rest_framework/views.py", line 465, in handle_exception
    self.raise_uncaught_exception(exc)
  File "rest_framework/views.py", line 476, in raise_uncaught_exception
    raise exc
  File "rest_framework/views.py", line 502, in dispatch
    response = handler(request, *args, **kwargs)
  File "rest_framework/generics.py", line 199, in get
    return self.list(request, *args, **kwargs)
  File "rest_framework/mixins.py", line 46, in list
    return Response(serializer.data)
  File "rest_framework/serializers.py", line 760, in data
    ret = super().data
  File "rest_framework/serializers.py", line 260, in data
    self._data = self.to_representation(self.instance)
  File "rest_framework/serializers.py", line 677, in to_representation
    return [
  File "rest_framework/serializers.py", line 678, in <listcomp>
    self.child.to_representation(item) for item in iterable
  File "rest_framework/serializers.py", line 516, in to_representation
    attribute = field.get_attribute(instance)
  File "rest_framework/fields.py", line 454, in get_attribute
    return get_attribute(instance, self.source_attrs)
  File "rest_framework/fields.py", line 94, in get_attribute
    instance = getattr(instance, attr)
  File "experimenter/experiments/models.py", line 481, in total_duration
    return (self.end_date - self.start_date).days

Will need to poke at it some more, but initial theory is that rapid experiments and/or so other type of experiment has no proposed duration so there wasn't an end_date computed

tiftran added a commit to tiftran/experimenter that referenced this issue Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants