Verified Commit 7028a4bd authored by Oliver Falk's avatar Oliver Falk

In order to be able to login with the ConfirmedOpenID, we need to create the...

In order to be able to login with the ConfirmedOpenID, we need to create the UserOpenID objects as well - issue #27
parent 83095f64
Pipeline #930 passed with stage
in 15 minutes and 7 seconds
......@@ -13,6 +13,7 @@ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ivatar.settings") # pylint: di
django.setup() # pylint: disable=wrong-import-position
from django.contrib.auth.models import User
from PIL import Image
from django_openid_auth.models import UserOpenID
from ivatar.settings import JPEG_QUALITY
from ivatar.ivataraccount.read_libravatar_export import read_gzdata as libravatar_read_gzdata
from ivatar.ivataraccount.models import ConfirmedEmail
......@@ -67,6 +68,11 @@ for file in os.listdir(PATH):
try:
ConfirmedOpenId.objects.get_or_create(openid=openid['openid'], user=user,
photo=saved_photos.get(openid['photo_id'])) # pylint: disable=no-member
UserOpenID.objects.get_or_create(
user_id=user.id,
claimed_id=openid['openid'],
display_id=openid['openid'],
)
except django.db.utils.IntegrityError:
print('%s not unique?' % openid['openid'])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment