Remove caniuse to always use jax
This commit is contained in:
parent
76b631366b
commit
c9091f2e75
1 changed files with 2 additions and 7 deletions
|
@ -6,7 +6,6 @@ from django.contrib.sites.shortcuts import get_current_site
|
||||||
from django.core.cache import cache
|
from django.core.cache import cache
|
||||||
from django.utils.functional import SimpleLazyObject, new_method_proxy
|
from django.utils.functional import SimpleLazyObject, new_method_proxy
|
||||||
|
|
||||||
from judge.utils.caniuse import CanIUse, SUPPORT
|
|
||||||
from .models import MiscConfig, NavigationBar, Profile
|
from .models import MiscConfig, NavigationBar, Profile
|
||||||
|
|
||||||
|
|
||||||
|
@ -121,14 +120,10 @@ def site_name(request):
|
||||||
|
|
||||||
|
|
||||||
def math_setting(request):
|
def math_setting(request):
|
||||||
caniuse = CanIUse(request.META.get("HTTP_USER_AGENT", ""))
|
|
||||||
|
|
||||||
if request.user.is_authenticated:
|
if request.user.is_authenticated:
|
||||||
engine = request.profile.math_engine
|
engine = request.profile.math_engine
|
||||||
else:
|
else:
|
||||||
engine = settings.MATHOID_DEFAULT_TYPE
|
engine = settings.MATHOID_DEFAULT_TYPE
|
||||||
if engine == "auto":
|
if engine == "auto":
|
||||||
engine = (
|
engine = "jax"
|
||||||
"mml" if bool(settings.MATHOID_URL) and caniuse.mathml == SUPPORT else "jax"
|
return {"MATH_ENGINE": engine, "REQUIRE_JAX": engine == "jax"}
|
||||||
)
|
|
||||||
return {"MATH_ENGINE": engine, "REQUIRE_JAX": engine == "jax", "caniuse": caniuse}
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue