[Patchew-devel] [PATCH] git: expose push options in the series/unapplied endpoint

Paolo Bonzini posted 1 patch 7 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/patchew-ci tags/patchew/20220225174305.612960-1-pbonzini@redhat.com
mods/git.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
[Patchew-devel] [PATCH] git: expose push options in the series/unapplied endpoint
Posted by Paolo Bonzini 7 months ago
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 mods/git.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/mods/git.py b/mods/git.py
index b1c4e14..50a1b39 100644
--- a/mods/git.py
+++ b/mods/git.py
@@ -358,10 +358,17 @@ class ApplierGetView(APILoginRequiredView):
 class UnappliedSeriesSerializer(SeriesSerializer):
     class Meta:
         model = Message
-        fields = SeriesSerializer.Meta.fields + ("mirror", "result_uri")
+        fields = SeriesSerializer.Meta.fields + ("mirror", "result_uri", "push_options")
 
     mirror = SerializerMethodField()
     result_uri = SerializerMethodField()
+    push_options = SerializerMethodField()
+
+    def get_push_options(self, obj):
+        if obj.project.config.get("git", {}).get("use_git_push_option", False):
+            return obj.git_result.data.get("git.push_options")
+        else:
+            return None
 
     def get_result_uri(self, obj):
         request = self.context["request"]
-- 
2.34.1

_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/patchew-devel