Don't add "Report a Bug" button for official tracker to non-official add-ons
authorJulian Eisel <eiseljulian@gmail.com>
Fri, 9 Mar 2018 20:17:43 +0000 (21:17 +0100)
committerJulian Eisel <eiseljulian@gmail.com>
Fri, 9 Mar 2018 20:22:24 +0000 (21:22 +0100)
If no custom URL was set, add-ons would get a "Report a Bug" button opening
the default developer.blender.org bug tracker. Now we only add this default
button if the add-on is bundled and not installed by the user.

release/scripts/startup/bl_ui/space_userpref.py

index ce3d6ff..e61a6ab 100644 (file)
@@ -1513,12 +1513,15 @@ class USERPREF_PT_addons(Panel):
                             split.operator(
                                 "wm.url_open", text="Documentation", icon='HELP',
                             ).url = info["wiki_url"]
-                        split.operator(
-                            "wm.url_open", text="Report a Bug", icon='URL',
-                        ).url = info.get(
-                            "tracker_url",
-                            "https://developer.blender.org/maniphest/task/edit/form/2",
-                        )
+                        # Only add "Report a Bug" button if tracker_url is set
+                        # or the add-on is bundled (use official tracker then).
+                        if info.get("tracker_url") or not user_addon:
+                            split.operator(
+                                "wm.url_open", text="Report a Bug", icon='URL',
+                            ).url = info.get(
+                                "tracker_url",
+                                "https://developer.blender.org/maniphest/task/edit/form/2",
+                            )
                         if user_addon:
                             split.operator(
                                 "wm.addon_remove", text="Remove", icon='CANCEL',