Created
January 11, 2013 14:28
-
-
Save jerith/4511036 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/go/conversation/views.py b/go/conversation/views.py | |
| index 4e76ad4..3001483 100644 | |
| --- a/go/conversation/views.py | |
| +++ b/go/conversation/views.py | |
| @@ -32,12 +32,10 @@ def index(request): | |
| if c.conversation_type == conversation_type] | |
| if conversation_status: | |
| - if conversation_status == 'running': | |
| - conversations = [c for c in conversations if c.running()] | |
| - elif conversation_status == 'finished': | |
| - conversations = [c for c in conversations if c.ended()] | |
| - elif conversation_status == 'draft': | |
| - conversations = [c for c in conversations if not c.started()] | |
| + # TODO: Use constants here? | |
| + if conversation_status in ('draft', 'running', 'finished'): | |
| + conversations = [c for c in conversations | |
| + if c.get_status() == conversation_status] | |
| else: | |
| raise ValueError( | |
| "Unknown conversation status: %s" % (conversation_status,)) | |
| diff --git a/go/vumitools/conversation/utils.py b/go/vumitools/conversation/utils.py | |
| index 5992c11..b2dd12d 100644 | |
| --- a/go/vumitools/conversation/utils.py | |
| +++ b/go/vumitools/conversation/utils.py | |
| @@ -227,6 +227,7 @@ class ConversationWrapper(object): | |
| if batch_id not in self.get_batch_keys(): | |
| self.c.batches.add_key(batch_id) | |
| + self.c.set_status_started() | |
| yield self.c.save() | |
| @Manager.calls_manager | |
| @@ -256,7 +257,6 @@ class ConversationWrapper(object): | |
| token_url,), | |
| }) | |
| self.c.batches.add_key(batch_id) | |
| - self.c.set_status_started() | |
| yield self.c.save() | |
| @Manager.calls_manager |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment