misc: coding style (#47302)

This commit is contained in:
Benjamin Dauvergne 2020-10-03 00:19:49 +02:00
parent 7a3be23b0d
commit e5e560982e
1 changed files with 1 additions and 5 deletions

View File

@ -14,19 +14,15 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import random
import struct
import time
try:
import threading
except ImportError:
threading = None
from binascii import hexlify
from django.conf import settings
from django.contrib import messages
from django.utils.deprecation import MiddlewareMixin
from django.utils.encoding import force_text
from django.utils.functional import SimpleLazyObject
from django.utils.translation import ugettext as _
from django.utils.six.moves.urllib import parse as urlparse
@ -66,7 +62,7 @@ class OpenedSessionCookieMiddleware(MiddlewareMixin):
domain = app_settings.A2_OPENED_SESSION_COOKIE_DOMAIN
if hasattr(request, 'user') and request.user.is_authenticated:
response.set_cookie(name, value='1', max_age=None, domain=domain,
secure=app_settings.A2_OPENED_SESSION_COOKIE_SECURE)
secure=app_settings.A2_OPENED_SESSION_COOKIE_SECURE)
elif app_settings.A2_OPENED_SESSION_COOKIE_NAME in request.COOKIES:
response.delete_cookie(name, domain=domain)
return response