On renomme pour être plus explicite
This commit is contained in:
parent
b80f1c038f
commit
8b6627087b
@ -1641,7 +1641,7 @@ class CategorisationRule(models.Model):
|
|||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def match_rules(event):
|
def get_category_from_rules(event):
|
||||||
rules = CategorisationRule.objects.all().order_by("weight", "pk")
|
rules = CategorisationRule.objects.all().order_by("weight", "pk")
|
||||||
|
|
||||||
for rule in rules:
|
for rule in rules:
|
||||||
|
@ -1731,7 +1731,7 @@ def apply_categorisation_rules(request):
|
|||||||
# first we check if events are not correctly categorised
|
# first we check if events are not correctly categorised
|
||||||
to_categorise = []
|
to_categorise = []
|
||||||
for e in Event.objects.filter(start_day__gte=datetime.now()).exclude(category=Category.get_default_category_id()):
|
for e in Event.objects.filter(start_day__gte=datetime.now()).exclude(category=Category.get_default_category_id()):
|
||||||
c = CategorisationRule.match_rules(e)
|
c = CategorisationRule.get_category_from_rules(e)
|
||||||
if c and c != e.category:
|
if c and c != e.category:
|
||||||
to_categorise.append((e, c))
|
to_categorise.append((e, c))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user