Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: use is_active method to know if the build should be skipped #8179

Merged
merged 2 commits into from
May 18, 2021
Merged
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions readthedocs/api/v2/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class ProjectAdminSerializer(ProjectSerializer):
)

environment_variables = serializers.SerializerMethodField()
skip = serializers.SerializerMethodField()

def get_environment_variables(self, obj):
"""Get all environment variables, including public ones."""
Expand All @@ -58,6 +59,9 @@ def get_environment_variables(self, obj):
for variable in obj.environmentvariable_set.all()
}

def get_skip(self, obj):
humitos marked this conversation as resolved.
Show resolved Hide resolved
return not Project.objects.is_active(obj)

class Meta(ProjectSerializer.Meta):
fields = ProjectSerializer.Meta.fields + (
'enable_epub_build',
Expand Down