Notify users to static compatible rules and update docs
This commit is contained in:
@ -81,8 +81,10 @@ class Segment(ClusterableModel):
|
|||||||
default=TYPE_DYNAMIC,
|
default=TYPE_DYNAMIC,
|
||||||
help_text=_(
|
help_text=_(
|
||||||
"The users in a dynamic segment will change as more or less users meet "
|
"The users in a dynamic segment will change as more or less users meet "
|
||||||
"the rules specified in the segment. Static segments will contain the "
|
"the rules specified in the segment. Static segments containing only "
|
||||||
"members that existed at creation."
|
"static compatible ruless will contain the members that existed at "
|
||||||
|
"creation. Mixed static segments or those containing entirely non "
|
||||||
|
"static compatible rules will be populated using the count variable."
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
count = models.PositiveSmallIntegerField(
|
count = models.PositiveSmallIntegerField(
|
||||||
@ -111,7 +113,10 @@ class Segment(ClusterableModel):
|
|||||||
MultiFieldPanel([
|
MultiFieldPanel([
|
||||||
InlinePanel(
|
InlinePanel(
|
||||||
"{}_related".format(rule_model._meta.db_table),
|
"{}_related".format(rule_model._meta.db_table),
|
||||||
label=rule_model._meta.verbose_name,
|
label='{}{}'.format(
|
||||||
|
rule_model._meta.verbose_name,
|
||||||
|
' ({})'.format(_('Static compatible')) if rule_model.static else ''
|
||||||
|
),
|
||||||
) for rule_model in AbstractBaseRule.__subclasses__()
|
) for rule_model in AbstractBaseRule.__subclasses__()
|
||||||
], heading=_("Rules")),
|
], heading=_("Rules")),
|
||||||
]
|
]
|
||||||
@ -124,7 +129,7 @@ class Segment(ClusterableModel):
|
|||||||
def clean(self):
|
def clean(self):
|
||||||
if self.is_static and not self.is_consistent and not self.count:
|
if self.is_static and not self.is_consistent and not self.count:
|
||||||
raise ValidationError({
|
raise ValidationError({
|
||||||
'count': _('Static segments with non-static rules must include a count.'),
|
'count': _('Static segments with non-static compatible rules must include a count.'),
|
||||||
})
|
})
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Reference in New Issue
Block a user