Commit 8cd2f2f1 authored by Daniel Klaffenbach's avatar Daniel Klaffenbach 🐍

development.middleware: Use "USERNAME" instead of "LOGNAME" on Windows

Closes #6
parent fdd04ad7
Pipeline #19224 passed with stage
in 52 seconds
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
import platform
from django.conf import settings
from django.contrib.auth.middleware import RemoteUserMiddleware
......@@ -13,7 +14,10 @@ class LocalUserMiddleware(RemoteUserMiddleware):
:attention: Never use this middleware in production environments!
"""
header = 'LOGNAME'
if platform.system() == 'Windows':
header = 'USERNAME'
else:
header = 'LOGNAME'
def __init__(self, *args, **kwargs):
super(LocalUserMiddleware, self).__init__(*args, **kwargs)
......
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