Update to config.py.example

This commit is contained in:
Francesco Siddi 2016-03-15 10:20:28 +01:00
parent 5c6bda1ba3
commit 1593e5c09d
4 changed files with 9 additions and 15 deletions

View File

@ -110,16 +110,14 @@ try:
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = \
app.config['GCLOUD_APP_CREDENTIALS']
except KeyError:
raise SystemExit('GOOGLE_APPLICATION_CREDENTIALS configuration is missing')
raise SystemExit('GCLOUD_APP_CREDENTIALS configuration is missing')
# Storage backend (GCS)
try:
os.environ['GCLOUD_PROJECT'] = \
app.config['GCLOUD_PROJECT']
os.environ['GCLOUD_PROJECT'] = app.config['GCLOUD_PROJECT']
except KeyError:
raise SystemExit('GCLOUD_PROJECT configuration value is missing')
# Algolia search
if 'ALGOLIA_USER' in app.config:
client = algoliasearch.Client(

View File

@ -6,15 +6,11 @@ def notification_parse(notification):
# notification = dict(a='n')
# TODO: finish fixing this
activities_collection = app.data.driver.db['activities']
activities_subscriptions_collection = app.data.driver.db['activities-subscriptions']
activities_subscriptions_collection = \
app.data.driver.db['activities-subscriptions']
users_collection = app.data.driver.db['users']
nodes_collection = app.data.driver.db['nodes']
activity = activities_collection.find_one({'_id': notification['activity']})
# actor = users_collection.find_one({'_id': activity['actor_user']})
# Context is optional
context_object_type = None
context_object_name = None
context_object_url = None
if activity['object_type'] != 'node':
return
@ -30,11 +26,10 @@ def notification_parse(notification):
if node['parent']['user'] == g.current_user['user_id']:
owner = "your {0}".format(node['parent']['node_type'])
else:
parent_comment_user = users_collection.find_one(
{'_id': node['parent']['user']})
owner = "{0}'s {1}".format(parent_comment_user['username'],
node['parent']['node_type'])
node['parent']['node_type'])
context_object_type = node['parent']['node_type']
context_object_name = owner
@ -51,7 +46,6 @@ def notification_parse(notification):
'context_object_type': 'node',
'context_object': context_object_id,
}
subscription = activities_subscriptions_collection.find_one(lookup)
if subscription and subscription['notifications']['web'] == True:
is_subscribed = True

View File

@ -56,7 +56,7 @@ def validate_token():
flask.g object, so that permissions and access to a resource can be defined
from it.
When the token is succesfully validated, sets `g.current_user` to contain
When the token is successfully validated, sets `g.current_user` to contain
the user information.
@returns True iff the user is logged in with a valid Blender ID token.

View File

@ -25,8 +25,10 @@ class Development(object):
# Credentials to access project on the Google Cloud where Google Cloud
# Storage is enabled (Pillar will automatically create and manage buckets)
GOOGLE_APPLICATION_CREDENTIALS = os.environ.get(
GCLOUD_APP_CREDENTIALS = os.environ.get(
'GOOGLE_APPLICATION_CREDENTIALS', '/data/config/google_app.json')
GCLOUD_PROJECT = os.environ.get('GCLOUD_PROJECT', 'blender-cloud')
# Fill in only if we plan to sign our urls using a the CDN
CDN_USE_URL_SIGNING = False