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
7 changes: 6 additions & 1 deletion common/segments/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,12 @@ def update(
return response

def validate_project_segment_limit(self, project: models.Model) -> None:
if project.segments.count() >= project.max_segments_allowed:
if (
apps.get_model("segments", "Segment")
.objects.filter(project=project)
.count()
>= project.max_segments_allowed
):
raise ValidationError(
{
"project": "The project has reached the maximum allowed segments limit."
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "flagsmith_common"
version = "0.1.0"
version = "1.4.1"
description = "A repository for including code that is required in multiple flagsmith repositories"
authors = ["Matthew Elwell <[email protected]>"]
readme = "README.md"
Expand Down
Loading