mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-12 02:26:26 +05:00
Check the rule for Attribute to be compile
This commit is contained in:
committed by
Dan Christian Bogos
parent
b7ddb2c066
commit
050b24fc76
@@ -62,13 +62,16 @@ func (apierV1 *ApierV1) SetAttributeProfile(alsPrf *engine.AttributeProfile, rep
|
||||
if len(alsPrf.Attributes) != 0 {
|
||||
for _, attr := range alsPrf.Attributes {
|
||||
for _, sub := range attr.Substitute {
|
||||
if missing := utils.MissingStructFields(sub, []string{"Rules", "AllFiltersMatch"}); len(missing) != 0 {
|
||||
if missing := utils.MissingStructFields(sub, []string{"Rules"}); len(missing) != 0 {
|
||||
return utils.NewErrMandatoryIeMissing(missing...)
|
||||
}
|
||||
if err := sub.Compile(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if err := apierV1.DataManager.SetAttributeProfile(alsPrf, true); err != nil {
|
||||
return utils.APIErrorHandler(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user