Currently, the flash_login_required decorator assumes that the user is utilizing Django authentication - attempting to get the user ID from the _auth_user_id session variable.
However, if another authentication scheme is being used, this variable will potentially not be set, and so causes the upload process to throw an exception and fail.
The easiest way around this is to inspect the request.user property and check to see if it has been set - if it has, we assume a middleware above has set it, and we'll use the ID of this user. If not, we fallback to checking the session variable as usual.
Currently, the flash_login_required decorator assumes that the user is utilizing Django authentication - attempting to get the user ID from the _auth_user_id session variable.
However, if another authentication scheme is being used, this variable will potentially not be set, and so causes the upload process to throw an exception and fail.
The easiest way around this is to inspect the request.user property and check to see if it has been set - if it has, we assume a middleware above has set it, and we'll use the ID of this user. If not, we fallback to checking the session variable as usual.