Projet

Général

Profil

0001-misc-use-tz-aware-datetimes-in-logged-errors-52989.patch

Frédéric Péters, 13 avril 2021 19:15

Télécharger (1,38 ko)

Voir les différences:

Subject: [PATCH] misc: use tz-aware datetimes in logged errors (#52989)

 wcs/logged_errors.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
wcs/logged_errors.py
14 14
# You should have received a copy of the GNU General Public License
15 15
# along with this program; if not, see <http://www.gnu.org/licenses/>.
16 16

  
17
import datetime
17
from django.utils.timezone import now
18 18

  
19 19
from wcs.carddef import CardDef
20 20
from wcs.formdef import FormDef
......
85 85
        if status:
86 86
            error.status_id = status.id
87 87

  
88
        error.first_occurence_timestamp = datetime.datetime.now()
88
        error.first_occurence_timestamp = now()
89 89
        error.tech_id = error.build_tech_id()
90 90
        existing_errors = list(cls.get_with_indexed_value('tech_id', error.tech_id))
91 91
        if existing_errors:
92 92
            error = existing_errors[0]
93 93
        error.occurences_count += 1
94
        error.latest_occurence_timestamp = datetime.datetime.now()
94
        error.latest_occurence_timestamp = now()
95 95
        error.store()
96 96
        return error
97 97

  
98
-