equal
deleted
inserted
replaced
39 """ |
39 """ |
40 |
40 |
41 super(Logic, self).__init__(model, base_model=base_model, |
41 super(Logic, self).__init__(model, base_model=base_model, |
42 scope_logic=scope_logic) |
42 scope_logic=scope_logic) |
43 |
43 |
|
44 def getToS(self, entity): |
|
45 """Returns the ToS Document of the Presence entity, or None if no ToS. |
|
46 |
|
47 Args: |
|
48 entity: Presence (or one of its sub-classes) entity that may or may |
|
49 not have a ToS Document attached |
|
50 """ |
|
51 if not entity: |
|
52 return None |
|
53 |
|
54 try: |
|
55 tos_doc = entity.tos |
|
56 except db.Error: |
|
57 return None |
|
58 |
|
59 return tos_doc |
|
60 |
44 |
61 |
45 logic = Logic() |
62 logic = Logic() |