コード例 #1
0
ファイル: models.py プロジェクト: heliodor/django-timetracker
 def update_password(self, string):
     '''Update our password to a new one whilst hashing it.'''
     self.salt = get_random_string(12)
     self.password = hasher(self.salt + string)
コード例 #2
0
 def update_password(self, string):
     '''Update our password to a new one whilst hashing it.'''
     self.salt = get_random_string(12)
     self.password = hasher(self.salt+string)
コード例 #3
0
ファイル: models.py プロジェクト: heliodor/django-timetracker
    def validate_password(self, string):
        '''We return whether our password matches the one we're supplied.

        This method will hash the string for you so you can pass in the
        raw string to check our password against.'''
        return hasher(self.salt + string) == self.password
コード例 #4
0
    def validate_password(self, string):
        '''We return whether our password matches the one we're supplied.

        This method will hash the string for you so you can pass in the
        raw string to check our password against.'''
        return hasher(self.salt + string) == self.password