equal
deleted
inserted
replaced
37 import soc.modules.ghop.logic.models.organization |
37 import soc.modules.ghop.logic.models.organization |
38 import soc.modules.ghop.models.task |
38 import soc.modules.ghop.models.task |
39 |
39 |
40 |
40 |
41 STATE_TRANSITIONS = { |
41 STATE_TRANSITIONS = { |
42 'Claimed': transitFromClaimed, |
42 'Claimed': 'transitFromClaimed', |
43 'NeedsReview': transitFromNeedsReview, |
43 'NeedsReview': 'transitFromNeedsReview', |
44 'ActionNeeded': transitFromActionNeeded, |
44 'ActionNeeded': 'transitFromActionNeeded', |
45 'NeedsWork': transitFromNeedsWork, |
45 'NeedsWork': 'transitFromNeedsWork', |
46 } |
46 } |
47 |
47 |
48 |
48 |
49 class Logic(base.Logic): |
49 class Logic(base.Logic): |
50 """Logic methods for the GHOPTask model. |
50 """Logic methods for the GHOPTask model. |
290 from soc.modules.ghop.tasks import task_update |
290 from soc.modules.ghop.tasks import task_update |
291 |
291 |
292 if entity.deadline and datetime.datetime.now() > entity.deadline: |
292 if entity.deadline and datetime.datetime.now() > entity.deadline: |
293 # calls a specific method to make a transition depending on the |
293 # calls a specific method to make a transition depending on the |
294 # task's current state |
294 # task's current state |
295 transit_func = STATE_TRANSITIONS[entity.status] |
295 transit_func = getattr(self, STATE_TRANSITIONS[entity.status]) |
296 update_dict = transit_func(entity) |
296 update_dict = transit_func(entity) |
297 |
297 |
298 comment_properties = { |
298 comment_properties = { |
299 'parent': entity, |
299 'parent': entity, |
300 'scope_path': entity.key().name(), |
300 'scope_path': entity.key().name(), |