Skip to content

Commit 0a623f0

Browse files
author
Joseph Damiba
committed
updating check-order so that no post can have order 5 since that is the order of the more post on the index page
1 parent d4d61f9 commit 0a623f0

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

check-order.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,13 @@
2828
order = []
2929

3030
for post in sortedPostFamily:
31+
if post['order'] == 5:
32+
raise Exception("Order Check Failed! Post {} cannot have order 5!".format(post['path']))
3133
order.append(post['order'])
3234

3335
if order[0] != 1:
3436
raise Exception("Order Check Failed! First post does not have order 1!")
3537

36-
def checkSequential(l):
37-
return all(i == j-1 for i, j in zip(l, l[1:]))
38-
3938
def checkConsecutive(l):
4039
return sorted(l) == list(range(min(l), max(l)+1))
4140

@@ -46,7 +45,4 @@ def checkConsecutive(l):
4645
except:
4746
raise Exception("Order Check Failed! Orders are not consecutive integers!!")
4847

49-
if not checkSequential(order):
50-
raise Exception("Order Check Failed! Orders are not sequential integers!!")
51-
5248
print("Order Checks Passed!")

0 commit comments

Comments
 (0)