Commit cb98235d by François C.

Merge branch 'without_couchdb_exception' into 'dev_cooperatic'

Display a message if reception couchdb is not in settings_secret.py

See merge request !38
parents 4b45b58b 3a195b27
Pipeline #1129 passed with stage
in 1 minute 21 seconds
...@@ -26,10 +26,10 @@ def as_text(value): ...@@ -26,10 +26,10 @@ def as_text(value):
def home(request): def home(request):
"""Page de selection de la commande suivant un fournisseurs""" """Page de selection de la commande suivant un fournisseurs"""
if 'reception' in settings.COUCHDB['dbs']:
context = { context = {
'title': 'Reception', 'title': 'Reception',
'merge_orders_pswd': settings.RECEPTION_MERGE_ORDERS_PSWD, 'merge_orders_pswd': getattr(settings, 'RECEPTION_MERGE_ORDERS_PSWD', 'makeastop'),
'couchdb_server': settings.COUCHDB['url'], 'couchdb_server': settings.COUCHDB['url'],
'db': settings.COUCHDB['dbs']['reception'], 'db': settings.COUCHDB['dbs']['reception'],
'POUCHDB_VERSION': getattr(settings, 'POUCHDB_VERSION', '') 'POUCHDB_VERSION': getattr(settings, 'POUCHDB_VERSION', '')
...@@ -37,6 +37,8 @@ def home(request): ...@@ -37,6 +37,8 @@ def home(request):
template = loader.get_template('reception/index.html') template = loader.get_template('reception/index.html')
return HttpResponse(template.render(context, request)) return HttpResponse(template.render(context, request))
else:
return HttpResponse("Need to configure reception couchdb db in settings_secret.py")
def get_list_orders(request): def get_list_orders(request):
......
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