Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions common/projects/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# Note that this does not impact change requests in an environment
MANAGE_PROJECT_LEVEL_CHANGE_REQUESTS = "MANAGE_PROJECT_LEVEL_CHANGE_REQUESTS"
APPROVE_PROJECT_LEVEL_CHANGE_REQUESTS = "APPROVE_PROJECT_LEVEL_CHANGE_REQUESTS"
CREATE_PROJECT_LEVEL_CHANGE_REQUESTS = "CREATE_PROJECT_LEVEL_CHANGE_REQUESTS"

TAG_SUPPORTED_PERMISSIONS = [DELETE_FEATURE]

Expand All @@ -31,5 +32,9 @@
APPROVE_PROJECT_LEVEL_CHANGE_REQUESTS,
"Ability to approve project level change requests.",
),
(
CREATE_PROJECT_LEVEL_CHANGE_REQUESTS,
"Ability to create project level change requests.",
),
(MANAGE_TAGS, "Allows the user to manage tags in the given project."),
]
14 changes: 12 additions & 2 deletions common/segments/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,19 @@

class ConditionSerializer(serializers.ModelSerializer):
delete = serializers.BooleanField(write_only=True, required=False)
version_of = RecursiveField(required=False, allow_null=True)

class Meta:
model = apps.get_model("segments", "Condition")
fields = ("id", "operator", "property", "value", "description", "delete")
fields = (
"id",
"operator",
"property",
"value",
"description",
"delete",
"version_of",
)

def validate(self, attrs):
super(ConditionSerializer, self).validate(attrs)
Expand All @@ -42,10 +51,11 @@ class RuleSerializer(serializers.ModelSerializer):
delete = serializers.BooleanField(write_only=True, required=False)
conditions = ConditionSerializer(many=True, required=False)
rules = ListSerializer(child=RecursiveField(), required=False)
version_of = RecursiveField(required=False, allow_null=True)

class Meta:
model = apps.get_model("segments", "SegmentRule")
fields = ("id", "type", "rules", "conditions", "delete")
fields = ("id", "type", "rules", "conditions", "delete", "version_of")


class SegmentSerializer(serializers.ModelSerializer, SerializerWithMetadata):
Expand Down
Loading