From 0789a621a35bc78f5c8663c25c11f8fd11a0c651 Mon Sep 17 00:00:00 2001 From: Marco Marche Date: Sat, 29 Mar 2014 10:20:50 +0100 Subject: [PATCH 1/2] default email address for new users can be defined in settings TWYTHON_DJANGO_DEFAULT_EMAIL --- twython_django_oauth/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twython_django_oauth/views.py b/twython_django_oauth/views.py index d2c942e..08cefb3 100644 --- a/twython_django_oauth/views.py +++ b/twython_django_oauth/views.py @@ -63,7 +63,7 @@ def thanks(request, redirect_url=settings.LOGIN_REDIRECT_URL): user = User.objects.get(username=authorized_tokens['screen_name']) except User.DoesNotExist: # We mock a creation here; no email, password is just the token, etc. - user = User.objects.create_user(authorized_tokens['screen_name'], "fjdsfn@jfndjfn.com", authorized_tokens['oauth_token_secret']) + user = User.objects.create_user(authorized_tokens['screen_name'], settings.TWYTHON_DJANGO_DEFAULT_EMAIL or "fjdsfn@jfndjfn.com", authorized_tokens['oauth_token_secret']) profile = TwitterProfile() profile.user = user profile.oauth_token = authorized_tokens['oauth_token'] From 522fa6496a4af89fd1641e210a28d68775574bfa Mon Sep 17 00:00:00 2001 From: Marco Marche Date: Sat, 29 Mar 2014 10:20:50 +0100 Subject: [PATCH 2/2] default email address for new users can be defined in settings TWYTHON_DJANGO_DEFAULT_EMAIL --- README.rst | 2 ++ twython_django_oauth/views.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index dd9717f..d9f745f 100644 --- a/README.rst +++ b/README.rst @@ -62,6 +62,8 @@ Modify settings.py LOGOUT_URL='/your_url_extension/logout' LOGIN_REDIRECT_URL='/' LOGOUT_REDIRECT_URL='/' + + TWYTHON_DJANGO_DEFAULT_EMAIL = 'test@example.com' Need Twython Help? ------------------ diff --git a/twython_django_oauth/views.py b/twython_django_oauth/views.py index d2c942e..08cefb3 100644 --- a/twython_django_oauth/views.py +++ b/twython_django_oauth/views.py @@ -63,7 +63,7 @@ def thanks(request, redirect_url=settings.LOGIN_REDIRECT_URL): user = User.objects.get(username=authorized_tokens['screen_name']) except User.DoesNotExist: # We mock a creation here; no email, password is just the token, etc. - user = User.objects.create_user(authorized_tokens['screen_name'], "fjdsfn@jfndjfn.com", authorized_tokens['oauth_token_secret']) + user = User.objects.create_user(authorized_tokens['screen_name'], settings.TWYTHON_DJANGO_DEFAULT_EMAIL or "fjdsfn@jfndjfn.com", authorized_tokens['oauth_token_secret']) profile = TwitterProfile() profile.user = user profile.oauth_token = authorized_tokens['oauth_token']