diff --git a/brutaldon/settings.py b/brutaldon/settings.py index 77854a9..3d571e2 100644 --- a/brutaldon/settings.py +++ b/brutaldon/settings.py @@ -199,5 +199,8 @@ SESSION_SERIALIZER = "django.contrib.sessions.serializers.PickleSerializer" # URL to redirect users to when not logged in ANONYMOUS_HOME_URL = "about" +# URL to redirect gab users to +GAB_RICKROLL_URL = "https://invidio.us/watch?v=dQw4w9WgXcQ" + # Version number displayed on about page BRUTALDON_VERSION = "2.12.1" diff --git a/brutaldon/views.py b/brutaldon/views.py index 9db84b0..beb9b13 100644 --- a/brutaldon/views.py +++ b/brutaldon/views.py @@ -352,6 +352,8 @@ def login(request): redirect_uris = request.build_absolute_uri(reverse("oauth_callback")) if form.is_valid(): api_base_url = form.cleaned_data["instance"] + if "gab.com" in api_base_url: + return redirect(django_settings.GAB_RICKROLL_URL) tmp_base = parse.urlparse(api_base_url.lower()) if tmp_base.netloc == "": api_base_url = parse.urlunparse( @@ -461,6 +463,8 @@ def old_login(request): form = LoginForm(request.POST) if form.is_valid(): api_base_url = form.cleaned_data["instance"] + if "gab.com" in api_base_url: + return redirect(django_settings.GAB_RICKROLL_URL) tmp_base = parse.urlparse(api_base_url.lower()) if tmp_base.netloc == "": api_base_url = parse.urlunparse(