From baa02367ecd75932ed785efe44b129c8d773696e Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Sat, 1 Oct 2011 16:36:30 -0300 Subject: added a fix for problem described at http://askbot.org/en/question/656/keyerror-on-clicking-manage-login-methods and added transifex config --- .tx/config | 8 ++++++++ askbot/deps/django_authopenid/views.py | 24 +++++++++++++++++------- 2 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 .tx/config diff --git a/.tx/config b/.tx/config new file mode 100644 index 00000000..ddc84185 --- /dev/null +++ b/.tx/config @@ -0,0 +1,8 @@ +[main] +host = https://www.transifex.net + +[askbot.txo] +file_filter = askbot/locale//LC_MESSAGES/django.po +source_file = askbot/locale/en/LC_MESSAGES/django.po +source_lang = en + diff --git a/askbot/deps/django_authopenid/views.py b/askbot/deps/django_authopenid/views.py index 63c3b1f0..5a81f702 100644 --- a/askbot/deps/django_authopenid/views.py +++ b/askbot/deps/django_authopenid/views.py @@ -550,13 +550,23 @@ def show_signin_view( for login_method in existing_login_methods: if login_method.provider_name == 'facebook': continue#it is disabled - provider_data = providers[login_method.provider_name] - if provider_data['type'] == 'password': - #only external password logins will not be deletable - #this is because users with those can lose access to their accounts permanently - login_method.is_deletable = provider_data.get('password_changeable', False) - else: - login_method.is_deletable = True + try: + provider_data = providers[login_method.provider_name] + if provider_data['type'] == 'password': + #only external password logins will not be deletable + #this is because users with those can lose access to their accounts permanently + login_method.is_deletable = provider_data.get('password_changeable', False) + else: + login_method.is_deletable = True + except KeyError: + logging.critical( + 'login method %s is no longer available ' + 'please delete records for this login method ' + 'from the UserAssociation table', + login_method.provider_name + ) + continue + if view_subtype == 'default': -- cgit v1.2.3-1-g7c22