lava_scheduler_app.views: drop call to Request.is_ajax()

Request.is_ajax() is deprecated in Django 3.1 and removed in Django 4.
For now, inline the current definition of Request.is_ajax(), because
that's compatible with our usage.
18 jobs for django-3.2 in 15 minutes (queued for 10 seconds)
Status Name Job ID Coverage
  Test
passed dispatcher-debian-10 #141687
amd64

00:02:26

passed dispatcher-debian-11 #141689
amd64

00:02:26

passed server-debian-10 #141688
amd64

00:02:55

passed server-debian-11 #141690
amd64

00:05:02

 
  Analyze
passed bandit-sast #141691
amd64-dind

00:00:57

passed black #141694
amd64

00:00:45

passed code_quality #141695
amd64

00:00:23

passed codespell #141700
amd64

00:00:19

passed coverage #141696
amd64

00:06:54

61.03%
passed dockerfiles #141697
amd64

00:00:18

passed eslint-sast #141692
amd64-dind

00:00:24

passed pylint #141699
amd64

00:02:33

passed schemas #141698
amd64

00:00:32

passed semgrep-sast #141693
amd64-dind

00:01:09

 
  Build
passed debian/10 #141702
amd64

00:01:46

passed doc #141701
amd64

00:00:35

passed docker-amd64-dispatcher #141703
amd64-dind

00:02:06

passed docker-amd64-server #141704
amd64-dind

00:02:58