Commit f7093a352fa20825ab7b7e463944dc5a7c3c6262

Authored by Alexis Koralewski
1 parent eaffd837
Exists in dev

use environment variable to get the path to observatory configuration file (prev…

…iously pyros was using the Django settings)
Showing 1 changed file with 3 additions and 2 deletions   Show diff stats
src/core/pyros_django/user_manager/views.py
... ... @@ -11,6 +11,7 @@ from django.urls import reverse
11 11 from django.http import HttpResponseRedirect,HttpResponse
12 12 from obsconfig.configpyros import ConfigPyros
13 13 from django.conf import settings as pyros_settings
  14 +import os
14 15  
15 16 LOGGED_PAGE = "../../dashboard/templates/dashboard/index.html"
16 17  
... ... @@ -99,7 +100,7 @@ def login_validation(request):
99 100 View called when the user log in (form submitted)
100 101 '''
101 102 if request.user.is_authenticated:
102   - config = ConfigPyros(pyros_settings.PATH_TO_OBSCONF_FILE)
  103 + config = ConfigPyros(os.environ["PATH_TO_OBSCONF_FILE"])
103 104 observatory_name = config.get_obs_name()
104 105 first_unit_name = config.get_units_name()[0]
105 106 request.session["obsname"] = observatory_name+" "+first_unit_name
... ... @@ -167,7 +168,7 @@ def user_logout(request):
167 168 '''
168 169  
169 170 logout(request)
170   - config = ConfigPyros(pyros_settings.PATH_TO_OBSCONF_FILE)
  171 + config = ConfigPyros(os.environ["PATH_TO_OBSCONF_FILE"])
171 172 observatory_name = config.get_obs_name()
172 173 first_unit_name = config.get_units_name()[0]
173 174 request.session["obsname"] = observatory_name+" "+first_unit_name
... ...