mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-13 18:46:25 +01:00
Compare commits
1 Commits
db0d3263cf
...
e82fffbf7a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e82fffbf7a |
@@ -174,10 +174,6 @@ class DataTablesView(View):
|
|||||||
draw = int(table_conf["draw"])
|
draw = int(table_conf["draw"])
|
||||||
start = int(table_conf["start"])
|
start = int(table_conf["start"])
|
||||||
length = int(table_conf["length"])
|
length = int(table_conf["length"])
|
||||||
if length <= 0:
|
|
||||||
logger.warning(
|
|
||||||
"Using no pagination is not recommended for server side rendered datatables"
|
|
||||||
)
|
|
||||||
limit = start + length
|
limit = start + length
|
||||||
|
|
||||||
|
|
||||||
@@ -196,10 +192,7 @@ class DataTablesView(View):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# build output
|
# build output
|
||||||
if length > 0:
|
for row in qs[start:limit]:
|
||||||
qs = qs[start:limit]
|
|
||||||
|
|
||||||
for row in qs:
|
|
||||||
ctx = {"row": row}
|
ctx = {"row": row}
|
||||||
row = []
|
row = []
|
||||||
for t in self.columns:
|
for t in self.columns:
|
||||||
|
|||||||
@@ -267,12 +267,3 @@ class TestDataTables(TestCase):
|
|||||||
response.setup(request)
|
response.setup(request)
|
||||||
data = json.loads(response.get(request).content)["data"]
|
data = json.loads(response.get(request).content)["data"]
|
||||||
self.assertEqual(len(data), 19)
|
self.assertEqual(len(data), 19)
|
||||||
|
|
||||||
def test_view_cc_no_pagination(self):
|
|
||||||
self.get_params["length"] = "-1"
|
|
||||||
self.client.force_login(self.user)
|
|
||||||
request = self.factory.get('/fake-url/', data=self.get_params)
|
|
||||||
response = TestView()
|
|
||||||
response.setup(request)
|
|
||||||
data = json.loads(response.get(request).content)["data"]
|
|
||||||
self.assertEqual(len(data), 20)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user