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

Issue 23 - Remove liveblog workflow #31

Merged
merged 1 commit into from May 27, 2016
Merged

Issue 23 - Remove liveblog workflow #31

merged 1 commit into from May 27, 2016

Conversation

rodfersou
Copy link
Member

closes #23

modified = datetime.fromtimestamp(timestamp)
timedelta = datetime.now() - modified
# Last modification is less than 2 days ago
return timedelta.days < 2
Copy link
Member

Choose a reason for hiding this comment

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

you better compare against a timedelta object, something like:

from datetime import timedelta
return timedelta(days=1) < datetime.now() - modified

@hvelarde
Copy link
Member

you forgot to update the documentation

@rodfersou
Copy link
Member Author

I didn't forget, the PR is not ready

@@ -1,9 +1,9 @@
<?xml version="1.0"?>
<object name="portal_workflow" meta_type="Plone Workflow Tool">
<object name="liveblog_workflow" meta_type="Workflow"/>
<object name="liveblog_workflow" meta_type="Workflow" purge="True" />
Copy link
Member

Choose a reason for hiding this comment

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

this can be done programmatically to avid having to register a new profile

# simulate (partially) state on previous version
wtool = api.portal.get_tool('portal_workflow')
wtool.setChainForPortalTypes(('Liveblog',), ('liveblog_workflow',))
assert wtool.getChainForPortalType('Liveblog') == ('liveblog_workflow',)
Copy link
Member Author

Choose a reason for hiding this comment

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

why not use self.assertEqual here?

Copy link
Member

Choose a reason for hiding this comment

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

because that is not a test, but a precondition for a test; the result is the same, is just semantics.

@hvelarde hvelarde merged commit fc131da into master May 27, 2016
@hvelarde hvelarde deleted the issue_23 branch May 27, 2016 13:43
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.

Get rid of the Liveblog workflow
2 participants