Update emailrelated.py

Fixed bug in django 1.7