@@ -67,7 +67,8 @@ def hash_type(state):
67
67
@staticmethod
68
68
def hash_id (salt , user_id , requester , state ):
69
69
"""
70
- Sets a user id to the internal_response, in the format specified by the internal response
70
+ Sets a user id to the internal_response,
71
+ in the format specified by the internal response
71
72
72
73
:type salt: str
73
74
:type user_id: str
@@ -84,13 +85,15 @@ def hash_id(salt, user_id, requester, state):
84
85
hash_type = UserIdHasher .hash_type (state )
85
86
if hash_type == UserIdHashType .transient :
86
87
timestamp = datetime .datetime .now ().time ()
87
- user_id = "{req}{time}{id}" .format (req = requester , time = timestamp , id = user_id )
88
- elif hash_type == UserIdHashType .persistent or hash_type == UserIdHashType .pairwise :
88
+ user_id = "{req}{time}{id}" .format (req = requester , time = timestamp ,
89
+ id = user_id )
90
+ elif (hash_type == UserIdHashType .persistent or
91
+ hash_type == UserIdHashType .pairwise ):
89
92
user_id = "{req}{id}" .format (req = requester , id = user_id )
90
93
elif hash_type == UserIdHashType .public :
91
94
user_id = "{id}" .format (id = user_id )
92
- elif hash_type == UserIdHashType .emailaddress or \
93
- hash_type == UserIdHashType .unspecified :
95
+ elif ( hash_type == UserIdHashType .emailaddress or
96
+ hash_type == UserIdHashType .unspecified ) :
94
97
return user_id
95
98
else :
96
99
raise ValueError ("Unknown hash type: '{}'" .format (hash_type ))
0 commit comments