Bug fixes, Additional admin shit, removal of is_active

Django handles is_active for you, If your account is disabled, The site will act as if you are not authenticated.  This means that all is_active checks are now pointless.

- Fixed C-Token deduction
- Removed is_active middleware
- Removed check for signup_addr when signing up
- Removed is_active logout message
- Added lazy asf check that makes a profile for you if one is not found.
- Removed community owner exception for rank_needed_to_post
- Removed unused permission thing
- Improved the admin interface even more.
This commit is contained in:
some weird guy
2023-09-16 15:43:30 -07:00
parent b049458816
commit bdab42a155
5 changed files with 57 additions and 51 deletions
-12
View File
@@ -87,18 +87,6 @@ class ClosedMiddleware(object):
if settings.CLOSEDVERSE_PROD not request.is_secure() and not 'Nintendo' in request.META['HTTP_USER_AGENT']:
return redirect('https://{0}{1}'.format(request.get_host(), request.get_full_path()))
"""
if request.user.is_authenticated:
"""
if not request.user.is_active:
if request.user.warned_reason:
ban_msg = request.user.warned_reason
else:
ban_msg = 'You are banned.'
return HttpResponseForbidden(ban_msg)
"""
# can just forbid post requests for the time being (but leav our funny logout message :3)
if not request.user.is_active and request.method != 'GET' and request.get_full_path() != '/logout/':
return HttpResponseForbidden()
response = self.get_response(request)
if request.user.is_authenticated:
# for reverse proxy