8687.15.11
by Karl Fogel
Add the copyright header block to files under lib/lp/answers/. |
1 |
# Copyright 2009 Canonical Ltd. This software is licensed under the
|
2 |
# GNU Affero General Public License version 3 (see the file LICENSE).
|
|
4319.2.50
by Francis J. Lacoste
Add +edit view on IFAQ. |
3 |
|
4319.2.56
by Francis J. Lacoste
Add subscriber to __all__ |
4 |
"""Subscribers for `IFAQ`."""
|
4319.2.50
by Francis J. Lacoste
Add +edit view on IFAQ. |
5 |
|
6 |
__metaclass__ = type |
|
4319.2.56
by Francis J. Lacoste
Add subscriber to __all__ |
7 |
__all__ = ['update_last_updated'] |
4319.2.50
by Francis J. Lacoste
Add +edit view on IFAQ. |
8 |
|
9 |
||
10 |
from canonical.database.constants import UTC_NOW |
|
7675.110.3
by Curtis Hovey
Ran the migration script to move registry code to lp.registry. |
11 |
from lp.registry.interfaces.person import IPerson |
4319.2.50
by Francis J. Lacoste
Add +edit view on IFAQ. |
12 |
|
13 |
||
14 |
def update_last_updated(faq, event): |
|
15 |
"""Update the last_updated_by and date_last_updated attributes."""
|
|
7876.3.12
by Francis J. Lacoste
Event.user is a principal, so we need an IPerson case. |
16 |
faq.last_updated_by = IPerson(event.user) |
4319.2.50
by Francis J. Lacoste
Add +edit view on IFAQ. |
17 |
faq.date_last_updated = UTC_NOW |