Merge models.py from master to nginx-secure-link