Skip to content

Commit

Permalink
lower email
Browse files Browse the repository at this point in the history
  • Loading branch information
pvyParts committed Jul 7, 2021
1 parent 85ec740 commit 42902fb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wikijs/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def __generate_group_list(self, names):
### Users *****************************************************************************************************
def __find_user(self, email):
logger.debug("Hitting API looking for: {}".format(email[:10]))
data = json.loads(self.client.execute(_find_user_query, variables={"char_email":email}))
data = json.loads(self.client.execute(_find_user_query, variables={"char_email":email.lower()}))
logger.debug("API returned: {}".format(data))
users = data.get("data", {}).get("users", {}).get("search", [])
if users is None:
Expand All @@ -121,12 +121,12 @@ def __create_user(self, user, password=False):
data = json.loads(self.client.execute(_create_user_mutation,
variables={
"group_list":group_list,
"email":user.email,
"email":user.email.lower(),
"name":name,
"pass":password}))
logger.debug("API returned: {}".format(data))
if data["data"]["users"]["create"]["responseResult"]["succeeded"]:
uid = self.__find_user(user.email)
uid = self.__find_user(user.lower())
if uid:
WikiJs.objects.update_or_create(user=user, uid=uid)
return uid
Expand Down Expand Up @@ -225,7 +225,7 @@ def update_user(self, user):
def activate_user(self, user):
#search
try:
uid = self.__find_user(user.email)
uid = self.__find_user(user.email.lower())
#create
if not uid:
logger.info("Creating new user for {}".format(user.username))
Expand Down

0 comments on commit 42902fb

Please sign in to comment.