prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Admin: Main menu won't stay hidden
  Two issues (at least):
  Desktop:  If I close (minimize, desktop) main-menu and click any link, the menu appears again.
  Desktop to mobile: If I minimize the menu on a bigger desktop and then drag window smaller the menu appears again. 
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `shuup/admin/views/menu.py`
  Content:
  ```
  1 # -*- coding: utf-8 -*-
  2 # This file is part of Shuup.
  3 #
  4 # Copyright (c) 2012-2018, Shuup Inc. All rights reserved.
  5 #
  6 # This source code is licensed under the OSL-3.0 license found in the
  7 # LICENSE file in the root directory of this source tree.
  8 from django.http import JsonResponse
  9 from django.views.generic import TemplateView, View
  10 
  11 
  12 class MenuView(TemplateView):
  13     template_name = "shuup/admin/base/_main_menu.jinja"
  14 
  15 
  16 class MenuToggleView(View):
  17     def post(self, request, *args, **kwargs):
  18         request.session["menu_open"] = int(request.POST.get("menu_open", 0))
  19         return JsonResponse({"success": True})
  20
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/shuup/admin/views/menu.py b/shuup/admin/views/menu.py
  --- a/shuup/admin/views/menu.py
  +++ b/shuup/admin/views/menu.py
  @@ -15,5 +15,5 @@
   
   class MenuToggleView(View):
       def post(self, request, *args, **kwargs):
  -        request.session["menu_open"] = int(request.POST.get("menu_open", 0))
  +        request.session["menu_open"] = not bool(request.session.get("menu_open", True))
           return JsonResponse({"success": True})
  
verification_info: {"golden_diff": "diff --git a/shuup/admin/views/menu.py b/shuup/admin/views/menu.py\n--- a/shuup/admin/views/menu.py\n+++ b/shuup/admin/views/menu.py\n@@ -15,5 +15,5 @@\n \n class MenuToggleView(View):\n     def post(self, request, *args, **kwargs):\n-        request.session[\"menu_open\"] = int(request.POST.get(\"menu_open\", 0))\n+        request.session[\"menu_open\"] = not bool(request.session.get(\"menu_open\", True))\n         return JsonResponse({\"success\": True})\n", "issue": "Admin: Main menu won't stay hidden\nTwo issues (at least):\r\nDesktop:  If I close (minimize, desktop) main-menu and click any link, the menu appears again.\r\nDesktop to mobile: If I minimize the menu on a bigger desktop and then drag window smaller the menu appears again. \n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n# This file is part of Shuup.\n#\n# Copyright (c) 2012-2018, Shuup Inc. All rights reserved.\n#\n# This source code is licensed under the OSL-3.0 license found in the\n# LICENSE file in the root directory of this source tree.\nfrom django.http import JsonResponse\nfrom django.views.generic import TemplateView, View\n\n\nclass MenuView(TemplateView):\n    template_name = \"shuup/admin/base/_main_menu.jinja\"\n\n\nclass MenuToggleView(View):\n    def post(self, request, *args, **kwargs):\n        request.session[\"menu_open\"] = int(request.POST.get(\"menu_open\", 0))\n        return JsonResponse({\"success\": True})\n", "path": "shuup/admin/views/menu.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n# This file is part of Shuup.\n#\n# Copyright (c) 2012-2018, Shuup Inc. All rights reserved.\n#\n# This source code is licensed under the OSL-3.0 license found in the\n# LICENSE file in the root directory of this source tree.\nfrom django.http import JsonResponse\nfrom django.views.generic import TemplateView, View\n\n\nclass MenuView(TemplateView):\n    template_name = \"shuup/admin/base/_main_menu.jinja\"\n\n\nclass MenuToggleView(View):\n    def post(self, request, *args, **kwargs):\n        request.session[\"menu_open\"] = not bool(request.session.get(\"menu_open\", True))\n        return JsonResponse({\"success\": True})\n", "path": "shuup/admin/views/menu.py"}]}