Commit graph

83 commits

Author SHA1 Message Date
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
isszul
25ca523301 implemented suggested fix in #72 2016-11-02 13:30:05 +00:00
Rob Guttman
20eb91359a enhanced admin interface closes #1 2016-09-02 15:02:42 -04:00
Jan-Jelle Kester
7824fb27f1 Update middleware for Django 1.10 2016-08-17 22:45:02 +02:00
Nitesh Rijal
3aeab92b35 added admin filter by content_types 2016-08-16 18:58:06 +05:45
Nitesh Rijal
022ba4c730 added a simple admin interface for audit log entries 2016-08-16 08:23:36 +05:45
Jan-Jelle Kester
2d9fab421e Merge branch 'master' into flush-command 2016-08-02 17:32:31 +02:00
Jan-Jelle Kester
889cb16c64 Merge branch 'master' into migration-magic 2016-08-02 17:26:48 +02:00
Jan-Jelle Kester
81bcd47ab0 Add management command for deleting all log entries
Issue #57
2016-07-27 18:17:59 +02:00
Jan-Jelle Kester
eb0574d115 Change existing migration to fix issues for MySQL users
Issue #54
2016-07-27 17:32:19 +02:00
Jan-Jelle Kester
65ae0e6705 Upgrade django-jsonfield dependency 2016-07-27 17:27:48 +02:00
Jan-Jelle Kester
091dccf6a7 Proposed fix for issue #45 2016-01-23 22:38:02 +01:00
Jan-Jelle Kester
7524801bb7 Remove unwanted blank line 2016-01-23 21:13:43 +01:00
Justin Littman
16a8b158e0 Change get_for_objects to distinguish between number and text keys. 2016-01-05 11:59:43 -05:00
Keith Bussell
eeb65f746d Fix unregister call and add tests. Fixes #42 2015-11-11 14:07:31 -08:00
Scott Adams
26237a9863 Code nazi told me to put db_index=True at the front of the queue 2015-10-19 04:24:12 +02:00
Scott Adams
c4ed32b89b Add db_index=True to object_pk 2015-10-18 03:17:41 +02:00
Scott Adams
96e62781b8 Create 0006_object_pk_index.py
Seq Scan on auditlog_logentry on heroku postgres. I suspect because of missing index.

````
SELECT "auditlog_logentry"."id", "auditlog_logentry"."content_type_id", "auditlog_logentry"."object_pk", "auditlog_logentry"."object_id", "auditlog_logentry"."object_repr", "auditlog_logentry"."action", "auditlog_logentry"."changes", "auditlog_logentry"."actor_id", "auditlog_logentry"."remote_addr", "auditlog_logentry"."timestamp", "auditlog_logentry"."additional_data" FROM "auditlog_logentry" WHERE ("auditlog_logentry"."content_type_id" = %s AND "auditlog_logentry"."object_pk" = %s) 
```
2015-10-18 01:51:40 +02:00
Scott Adams
6b8f7b94a5 Create 0005_logentry_additional_data_verbose_name.py
Verbose name was missing from 004 so makemigrations causes this.
2015-10-18 01:47:45 +02:00
Jan-Jelle Kester
4bb432b489 Add app configs 2015-10-07 22:24:41 +02:00
jay7958
655e02e806 Changed import to use the new apps module for get_model, this removes
the Django warning:
site-packages/auditlog/middleware.py:9: RemovedInDjango19Warning: The utilities in django.db.models.loading are deprecated in favor of the new application loading system.
  from django.db.models.loading import get_model
2015-08-20 13:49:22 -05:00
jay7958
59fc9eff18 Changed import statement and reference to GenericRelation in order
to remove the following Django Warning:
site-packages/auditlog/models.py:6: RemovedInDjango19Warning:
  django.contrib.contenttypes.generic is deprecated and will be
  removed in Django 1.9. Its contents have been moved to the
  fields, forms, and admin submodules of
  django.contrib.contenttypes.
    from django.contrib.contenttypes import generic
2015-08-20 12:53:59 -05:00
Scott Adams
4dc11ab6fb Fixes #31 2015-07-29 13:27:15 +02: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
ed055d93bc Merge pull request #28 from jjkester/improved-diffs
Improve diffs
2015-07-22 00:35:09 +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
99d87bee52 Fix overlapping migrations 2015-07-22 00:24:46 +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
ef4b93a551 Merge pull request #29 from jjkester/threadlocals
Use threadlocals and log remote address
2015-07-21 23:50:40 +02:00
Jan-Jelle Kester
952536f255 Additional field for metadata 2015-07-21 23:46:31 +02:00
Ann Paul
23927ea317 Add verbose name to the additional_data field
Directly call the get_additional_data method without instance
2015-06-03 08:47:50 -07:00
Jan-Jelle Kester
0c0d1dffe1 Only set remote_addr in set_actor method 2015-06-03 16:49:04 +02:00
Jan-Jelle Kester
93e468ab03 Add remote address field to LogEntry and autopopulate it when possible 2015-06-03 16:45:51 +02:00
Jan-Jelle Kester
6e74d41268 Use threadlocals to store middleware data instead of the request 2015-06-03 16:29:40 +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
Ann Paul
72cdde6864 Change naming to use additional_data 2015-06-01 09:24:13 -07:00
Jan-Jelle Kester
ff09a69c6f Improve documentation 2015-05-31 15:06:06 +02:00
Jan-Jelle Kester
1173d3bc91 Fix issue with possible duplicates in get_for_objects method 2015-05-31 13:52:29 +02:00
Jan-Jelle Kester
3623812ab4 Some work on m2m relationships 2015-05-15 15:14:57 +02:00
Jan-Jelle Kester
3b04d88441 Improve code documentation 2015-05-15 01:25:44 +02:00
Jan-Jelle Kester
ae8461d1fe Merge pull request #22 from jjkester/python3
Support Python 3 as well as Python 2
2015-05-15 00:30:47 +02:00
Jan-Jelle Kester
b4a0144bfa Try to make migrations work for Django 1.7 2015-05-15 00:15:12 +02:00
Jan-Jelle Kester
f54623d3c1 Merge pull request #14 from johnrtipton/master
Compatibility with django-polymorphic
2015-04-29 12:06:37 +02:00
Ann Paul
d4522ad74a Add migration for detailed_object_repr field 2015-04-23 15:03:09 -07:00
Ann Paul
6a7908f2ca Add detailed_object_repr JSONField to logentry model 2015-04-23 15:02:58 -07:00
John R. Tipton
cc2e489f75 - Check for model using isinstance
- Check for model using isinstance and pk using _get_pk_value
2015-02-19 09:03:39 -05:00
Jan-Jelle Kester
e97c601038 First try at making Auditlog work with Python 3
Issue #15
2015-02-16 22:17:22 +01:00