Browse Source

HUE-8382 [core] fix django-axes 2.2.0 breaks with error field attempt_time can not be null

As per Django Doc : https://docs.djangoproject.com/en/1.11/ref/models/fields/#datefield
The difference between auto_now and auto_now_add options is: "auto_now" set the field to now every time the object is saved.

At https://github.com/cloudera/hue/blob/master/desktop/core/ext-py/django-axes-2.2.0/axes/decorators.py#L415
By changing https://github.com/cloudera/hue/blob/master/desktop/core/ext-py/django-axes-2.2.0/axes/models.py#L41 to "auto_now" fixes.

Tested:
Tested on SLES where it is failing.
Prakash Ranade 7 years ago
parent
commit
3a536645b0
1 changed files with 1 additions and 1 deletions
  1. 1 1
      desktop/core/ext-py/django-axes-2.2.0/axes/models.py

+ 1 - 1
desktop/core/ext-py/django-axes-2.2.0/axes/models.py

@@ -38,7 +38,7 @@ class CommonAccess(models.Model):
     )
 
     attempt_time = models.DateTimeField(
-        auto_now_add=True,
+        auto_now=True,
     )
 
     class Meta: