Commit graph

16 commits

Author SHA1 Message Date
Fernando Espíndola
e6ef7c5319 Use make_naive only if settings.USE_TZ is True. 2017-01-26 01:52:04 -02:00
Kevin Alberts
80bd115012 Move the value retrieval process to a separate function to make the diff code more DRY. 2017-01-18 09:36:16 +01:00
Kevin Alberts
6f4c6eb8a2 Make it so Django's timezone-aware DateTimeFields remain unchanged when Django resets the timezone. DateFields are not timezone-aware, so they do not need fixing.
Django converts the timezone of DateTimeFields to UTC when the field gets saved. This makes it so when you update a model which includes a DateTimeField, and your server is running in another timezone, the AuditLog will think you changed the timestamp, while it actually is the same time, but in another timezone. This commit adds a specific check in the model_instance_diff function for DateTimeField models (and any subclasses of it), which converts the old and new values to UTC before comparing them to see if they've actually changed. It also adds tests to see if the code works properly.

The extra test_setting (USE_TZ) is added because timezone support is disabled if it is not specified, this setting enables it.
2017-01-11 20:07:10 +01:00
Jan-Jelle Kester
dab0342cf6 Merge branch 'master' into release-0.3.0
Conflicts:
	src/auditlog/diff.py
2015-07-22 01:06:32 +02:00
Jan-Jelle Kester
ccaf3925e4 Provide fallback for when a field has no 'rel' attribute 2015-07-22 00:32:27 +02:00
Jan-Jelle Kester
7d6380206f Extract field tracking test, do not track any relation to LogEntry 2015-07-22 00:16:33 +02:00
Jan-Jelle Kester
a689823b26 Exclude AuditlogHistoryField from diffs 2015-07-22 00:03:54 +02:00
Jan-Jelle Kester
18a04cfe7e Use _meta API in diffs where possible 2015-06-03 16:06:25 +02:00
Jan-Jelle Kester
9d252f3310 Respect default values and non-string objects in diffs 2015-06-03 15:50:41 +02:00
Jan-Jelle Kester
ff09a69c6f Improve documentation 2015-05-31 15:06:06 +02:00
Jan-Jelle Kester
3b04d88441 Improve code documentation 2015-05-15 01:25:44 +02:00
Jan-Jelle Kester
e97c601038 First try at making Auditlog work with Python 3
Issue #15
2015-02-16 22:17:22 +01:00
Jan-Jelle Kester
eb50f0dffd Fix value lookup for nonexistent relations 2015-02-16 17:06:17 +01:00
Vittorio Zamboni
4ae09eb8b4 Changed registry from list to dictionary and use register kwargs to track fields that must be changed or excluded 2014-10-03 15:13:03 +02:00
Vitor Figueiro
ce8deb9415 replaced str with unicode in diff 2014-02-12 12:41:17 +00:00
Jan-Jelle Kester
81098cd179 Big commit: testproject, bugfixes, changed directory structure 2013-10-21 21:46:31 +02:00
Renamed from auditlog/diff.py (Browse further)