added 'remote_password' property to User model
authorTony Mack <tmack@tux.cs.princeton.edu>
Sat, 3 Jan 2015 19:26:15 +0000 (14:26 -0500)
committerTony Mack <tmack@tux.cs.princeton.edu>
Sat, 3 Jan 2015 20:22:09 +0000 (15:22 -0500)
planetstack/core/models/user.py

index b30e897..fb0d232 100644 (file)
@@ -1,6 +1,7 @@
 import os
 import datetime
 import sys
+import hashlib
 from collections import defaultdict
 from django.forms.models import model_to_dict
 from django.db import models
@@ -113,6 +114,10 @@ class User(AbstractBaseUser): #, DiffModelMixIn):
         return self.diff.get(field_name, None)
     # ---- end copy stuff from DiffModelMixin ----
 
+    @property
+    def remote_password(self):
+        return hashlib.md5(self.password).hexdigest()[:12]
+
     class Meta:
         app_label = "core"