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

Review Request #13087 - Created June 15, 2018 and submitted

Prakash Ranade
hue
master
hue
enricoberti, jgauthier, johan, ranade, romain, roohi, subrata, weixia, yingc
commit f156f55bbd514746e547aa99fa35967ff301dabe
Author: Prakash Ranade <ranade@cloudera.com>
Date:   Fri Jun 15 17:27:29 2018 -0700

    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.

:100644 100644 6e644816e1... 3a78721fc0... M	desktop/core/ext-py/django-axes-2.2.0/axes/models.py


  1. Ship It!
  2. 
      
  1. Won't it break other parts btw? (as it is still auto_now_add in the migration https://github.com/cloudera/hue/tree/master/desktop/core/ext-py/django-axes-2.2.0/axes/migrations)

    Is auto_now_add not compatible with SLES?

  2. 
      
Review request changed

Status: Closed (submitted)

Loading...