diff --git a/CHANGELOG b/CHANGELOG index a73453d..57aea1b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,10 @@ -30-08-2022 (AKo): V0.5.3 +30-08-2022 (AKo): v0.5.3.1 - Pyros container has fix hostname (hostname of local machine) - Adding switch of database if we're not in docker and not on the computer that host the database - Add fix IP adress for db_pyros and pyros container, updating database.env files to connect to db_pyros + - Add new shell script for build (with verification that user isn't root) + - Fixing endofline issue of windows + - Update logout for Django 4.1 (Send form POST) 29-08-2022 (AKo): v0.5.2.1 - Adding colors for recieved and sended commands of an agent. diff --git a/VERSION b/VERSION index c3bdc6c..f92cb92 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.2.1 +0.5.3.1 diff --git a/src/core/pyros_django/misc/templates/base.html b/src/core/pyros_django/misc/templates/base.html index 34ccfaf..4daaee3 100644 --- a/src/core/pyros_django/misc/templates/base.html +++ b/src/core/pyros_django/misc/templates/base.html @@ -387,10 +387,12 @@ footer{ {% endcomment %} - - - Logout - +
+ {% csrf_token %} + {% else %}
  • Sign in
  • diff --git a/src/core/pyros_django/user_manager/views.py b/src/core/pyros_django/user_manager/views.py index bb6719c..79313d9 100644 --- a/src/core/pyros_django/user_manager/views.py +++ b/src/core/pyros_django/user_manager/views.py @@ -178,16 +178,16 @@ def user_logout(request): ''' View called to log out. Redirects on login page. ''' - - log.info(f"User {request.user} did action logout") - logout(request) - config = OBSConfig( - os.environ["PATH_TO_OBSCONF_FILE"], os.environ["unit_name"]) - observatory_name = config.get_obs_name() - first_unit_name = config.get_units_name()[0] - request.session["obsname"] = observatory_name+" "+first_unit_name - return redirect(reverse("index")) - return(render(request, LOGGED_PAGE, {'USER_LEVEL': "Visitor", 'base_template': 'base.html', 'weather_img': "red"})) + if request.POST: + log.info(f"User {request.user} did action logout") + logout(request) + config = OBSConfig( + os.environ["PATH_TO_OBSCONF_FILE"], os.environ["unit_name"]) + observatory_name = config.get_obs_name() + first_unit_name = config.get_units_name()[0] + request.session["obsname"] = observatory_name+" "+first_unit_name + return redirect(reverse("index")) + return(render(request, LOGGED_PAGE, {'USER_LEVEL': "Visitor", 'base_template': 'base.html', 'weather_img': "red"})) def user_signin(request): -- libgit2 0.21.2