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

Grace period of >=24hours causes data corruption #18

Open
brianhempel opened this issue Dec 5, 2018 · 0 comments
Open

Grace period of >=24hours causes data corruption #18

brianhempel opened this issue Dec 5, 2018 · 0 comments

Comments

@brianhempel
Copy link

A duration of "24:17:17" ends up being stored as "1 00:17:17" which can't be reparsed as a duration and breaks a number of subsequent CLI commands (include attempts to change the duration back to a valid value, but hitting the REST API directly is able to correct the problem).

$ chisubmit instructor assignment set-attribute lab07 grace_period 24:17:17
ERROR: Unexpected exception
Traceback (most recent call last):
  File "/usr/local/chisubmit_client/lib/python3.5/site-packages/chisubmit/client/types.py", line 128, in to_python
    return parse_timedelta(value)
  File "/usr/local/chisubmit_client/lib/python3.5/site-packages/chisubmit/common/utils.py", line 75, in parse_timedelta
    l = [int(x) for x in l]
  File "/usr/local/chisubmit_client/lib/python3.5/site-packages/chisubmit/common/utils.py", line 75, in <listcomp>
    l = [int(x) for x in l]
ValueError: invalid literal for int() with base 10: '1 00'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/chisubmit_client/lib/python3.5/site-packages/chisubmit/cli/common.py", line 93, in new_func
    return f(*args, **kwargs)
  File "/usr/local/chisubmit_client/lib/python3.5/site-packages/chisubmit/cli/common.py", line 62, in new_func
    return f(*args, **kwargs)
  File "/usr/local/chisubmit_client/lib/python3.5/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/chisubmit_client/lib/python3.5/site-packages/chisubmit/cli/common.py", line 83, in new_func
    return ctx.invoke(f, ctx.obj["course_obj"], *args, **kwargs)
  File "/usr/local/chisubmit_client/lib/python3.5/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/chisubmit_client/lib/python3.5/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/chisubmit_client/lib/python3.5/site-packages/chisubmit/cli/shared/assignment.py", line 46, in shared_assignment_set_attribute
    api_obj_set_attribute(ctx, assignment, attr_name, attr_value)
  File "/usr/local/chisubmit_client/lib/python3.5/site-packages/chisubmit/cli/common.py", line 281, in api_obj_set_attribute
    api_obj.edit(**{attr_name: v})
  File "/usr/local/chisubmit_client/lib/python3.5/site-packages/chisubmit/client/types.py", line 325, in edit
    self._updateAttributes(data)
  File "/usr/local/chisubmit_client/lib/python3.5/site-packages/chisubmit/client/types.py", line 254, in _updateAttributes
    checked_value = api_attr.to_python(attrvalue, self._headers, self._api_client)
  File "/usr/local/chisubmit_client/lib/python3.5/site-packages/chisubmit/client/types.py", line 184, in to_python
    return self.type.to_python(value, headers, api_client)
  File "/usr/local/chisubmit_client/lib/python3.5/site-packages/chisubmit/client/types.py", line 130, in to_python
    raise AttributeTypeException(value, self)
chisubmit.client.types.AttributeTypeException: ('1 00:17:17', <chisubmit.client.types.AttributeType object at 0x7f99b7e2e4e0>)
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

1 participant