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

Feature blocking #510

Merged
merged 14 commits into from
Feb 23, 2020
Merged

Feature blocking #510

merged 14 commits into from
Feb 23, 2020

Conversation

hardbyte
Copy link
Collaborator

@hardbyte hardbyte commented Feb 20, 2020

Replaces #503. I can't review because I opened this PR.

Copy link
Collaborator

@wilko77 wilko77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the deletion of the tempfile should be sorted though. Otherwise it's fine.

backend/entityservice/views/project.py Outdated Show resolved Hide resolved
safe_fail_request(400, message='Missing CLK and Blocks information')
# fail condition5 - unknown element in JSON
if 'clks' not in clk_json and 'clknblocks' not in clk_json:
safe_fail_request(400, message='Unknown upload element - expect "clks" or "clknblocks"')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this function would throw an exception instead of calling safe_fail_request it would be nicely unit-testable.

raise ValueError('can only handle CLKs at the moment.')
binary_data = b'\n'.join(''.join(clk.split('\n')).encode() for clk in data['clks']) + b'\n'
buffer = io.BytesIO(binary_data)
#### END GLUE
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the most beautiful glue code I have ever seen.

@wilko77 wilko77 merged commit b5a7705 into develop Feb 23, 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

Successfully merging this pull request may close these issues.

3 participants