From 0488e084859cb3ff042db980d8d6e7cf1cc2ef79 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Fri, 1 Jan 2010 19:12:10 +0100 Subject: [PATCH] recognize more (most, I hope) mobile browsers --- pyweb/mumble/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyweb/mumble/views.py b/pyweb/mumble/views.py index c906e42..f04fbd9 100644 --- a/pyweb/mumble/views.py +++ b/pyweb/mumble/views.py @@ -35,7 +35,12 @@ from mmobjects import * def redir( request ): """ Redirect to the servers list. """ - if request.META['HTTP_USER_AGENT'].startswith( 'BlackBerry' ): + if request.META['HTTP_USER_AGENT'].startswith( 'BlackBerry' ) or \ + "Opera Mini" in request.META['HTTP_USER_AGENT'] or \ + "Windows CE" in request.META['HTTP_USER_AGENT'] or \ + "MIDP" in request.META['HTTP_USER_AGENT'] or \ + "Palm" in request.META['HTTP_USER_AGENT'] or \ + "iPhone" in request.META['HTTP_USER_AGENT']: return HttpResponseRedirect( reverse( mobile_mumbles ) ); else: return HttpResponseRedirect( reverse( mumbles ) );