diff --git a/src/apps/accounts/pipeline.py b/src/apps/accounts/pipeline.py index d930833..f478a6d 100644 --- a/src/apps/accounts/pipeline.py +++ b/src/apps/accounts/pipeline.py @@ -30,9 +30,12 @@ def save_profile(backend, user, response, *args, **kwargs): birthdate = response.get('birthday', '') if birthdate: user.profile.birthdate = datetime.strptime(birthdate, '%m/%d/%Y') - location = response.get('location', '') - if location: - user.profile.country = location['name'].split(', ')[1] + try: + location = response.get('location', '') + if location: + user.profile.country = location['name'].split(', ')[1] + except IndexError: + pass if user.profile.avatar: user.profile.save() else: diff --git a/src/edemocracia/settings.py b/src/edemocracia/settings.py index 5f046a1..2524195 100644 --- a/src/edemocracia/settings.py +++ b/src/edemocracia/settings.py @@ -247,7 +247,7 @@ COMPRESS_NODE_MODULES = NODE_MODULES COMPRESS_NODE_SASS_BIN = os.path.join(NODE_MODULES, '.bin/node-sass') COMPRESS_POSTCSS_BIN = os.path.join(NODE_MODULES, '.bin/postcss') -COMPRESS_OFFLINE = config('COMPRESS_OFFLINE', default=False) +COMPRESS_OFFLINE = config('COMPRESS_OFFLINE', cast=bool, default=False) if not DEBUG: COMPRESS_SCSS_COMPILER_CMD = '{node_sass_bin}' \