Revision c1f83918
[#1920] Nettoyage get_last_modification_timestamp
Change-Id: I87651ce4d724897ff43701f747a587f9fd2ac060
Refs: #1920
vigiboard/controllers/root.py | ||
---|---|---|
969 | 969 |
return dict(groups=groups, items=[]) |
970 | 970 |
|
971 | 971 |
def get_last_modification_timestamp(event_id_list, |
972 |
value_if_none=datetime.utcnow()):
|
|
972 |
value_if_none=datetime.utcnow): |
|
973 | 973 |
""" |
974 | 974 |
Récupère le timestamp de la dernière modification |
975 | 975 |
opérée sur l'un des événements dont l'identifiant |
... | ... | |
984 | 984 |
).scalar() |
985 | 985 |
|
986 | 986 |
if not last_modification_timestamp: |
987 |
if not value_if_none:
|
|
988 |
return None
|
|
987 |
if not callable(value_if_none):
|
|
988 |
return value_if_none
|
|
989 | 989 |
else: |
990 |
last_modification_timestamp = value_if_none |
|
991 |
return datetime.utcfromtimestamp(calendar.timegm( |
|
992 |
last_modification_timestamp.utctimetuple())) |
|
990 |
last_modification_timestamp = value_if_none() |
|
991 |
return last_modification_timestamp |
Also available in: Unified diff