Skip to content

Commit

Permalink
Delete code.
Browse files Browse the repository at this point in the history
No-Issue

Signed-off-by: James Tanner <[email protected]>
  • Loading branch information
jctanner committed Nov 21, 2023
1 parent 2808c98 commit 62c162a
Showing 1 changed file with 0 additions and 81 deletions.
81 changes: 0 additions & 81 deletions galaxy_ng/social/pipeline/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

import logging

# from galaxy_ng.app.models.auth import User
# from galaxy_ng.app.utils.galaxy import generate_unverified_email


logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -50,84 +47,6 @@ def create_user(strategy, details, backend, user=None, *args, **kwargs):
f'create_user(4): enumerate username:{username} email:{email} github_id:{github_id}'
)

'''
# check for all possible emails ...
possible_emails = [generate_unverified_email(github_id)]
if email:
possible_emails.append(email)
found_email = None
for possible_email in possible_emails:
# if the email is null maybe that causes the user hijacking?
if not possible_email:
continue
found_email = User.objects.filter(email=possible_email).first()
if found_email is not None:
logger.info(
f'create_user(5): found user {found_email}:{found_email.id}'
+ f' via email {possible_email}'
)
break
if found_email is not None:
# fix the username if they've changed their login since last time
if found_email.username != username:
logger.info(
f'create_user(6): set found user {found_email}:{found_email.id}'
+ f' username to {username}'
)
found_email.username = username
found_email.save()
if found_email.email != email:
logger.info(
f'create_user(7): set found user {found_email}:{found_email.id}'
+ f' email to {email}'
)
found_email.email = email
found_email.save()
logger.info(
f'create_user(8): returning found user {found_email}:{found_email.id}'
+ f' via email {possible_email}'
)
return {
'is_new': False,
'user': found_email
}
logger.info(f'create_user(9): did not find any users via matching emails {possible_emails}')
found_username = User.objects.filter(username=username).first()
if found_username:
logger.info(
f'create_user(10): found user:{found_username}:{found_username.id}:'
+ f'{found_username.email}'
+ f' by username:{username}'
)
if found_username is not None and found_username.email:
# we have an old user who's got the username but it's not the same person logging in ...
# so change that username? The email should be unique right?
logger.info(
f'create_user(11): set {found_username}:{found_username.id}:{found_username.email}'
+ f' username to {found_username.email}'
)
found_username.username = found_username.email
found_username.save()
found_username = User.objects.filter(username=username).first()
if found_username is not None:
logger.info(f'create_user(12): {found_username}')
return {
'is_new': False,
'user': found_username
}
'''

new_user = strategy.create_user(**fields)
logger.info(f'create_user(13): {new_user}')
return {
Expand Down

0 comments on commit 62c162a

Please sign in to comment.