Commit a03fc9d9 authored by Andrey Vertiprahov's avatar Andrey Vertiprahov
Browse files

Merge branch 'cherry-pick-ef62aadf' into 'release-22.1'

release-22.1:Backport!6272

See merge request noc/noc!6273
parents 3688b21d f41de50b
# ----------------------------------------------------------------------
# Migrate is_regex to is_matching field
# ----------------------------------------------------------------------
# Copyright (C) 2007-2022 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
# NOC modules
from noc.core.migration.base import BaseMigration
class Migration(BaseMigration):
depends_on = [("main", "0063_migrate_filter_labels")]
def migrate(self):
self.mongo_db["labels"].update_many({"is_regex": True}, {"$set": {"is_matching": True}})
......@@ -1176,7 +1176,7 @@ class Label(Document):
"""
rxs = []
for ll in Label.objects.filter(
__raw__={"is_regex": True, "match_regex": {"$elemMatch": {"scope": scope}}}
__raw__={"is_matching": True, "match_regex": {"$elemMatch": {"scope": scope}}}
):
for rx in ll.match_regex:
if rx.scope == scope:
......
......@@ -280,7 +280,7 @@ Ext.define("NOC.main.label.Application", {
value: "{is_matching}",
disabled: "{isEnableDisableRx}"
},
boxLabel: __("Regexp Label"),
boxLabel: __("Is Matching Label"),
},
{
name: "match_regex",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment