Skip to content
Permalink
Browse files

Merge pull request #6129 from alexbruy/plugins-rating

[plugin manager] fix sending plugin votes
  • Loading branch information
borysiasty committed Jan 22, 2018
2 parents 7a2ab1c + 08255f7 commit 2b2b65305f6cb139d645fa6458df73a67e5f55d8
Showing with 4 additions and 4 deletions.
  1. +4 −4 python/pyplugin_installer/installer.py
@@ -22,9 +22,9 @@
* *
***************************************************************************/
"""
from builtins import str

import os
import json
import zipfile

from qgis.PyQt.QtCore import Qt, QObject, QDir, QUrl, QFileInfo, QFile
@@ -525,10 +525,10 @@ def sendVote(self, plugin_id, vote):
if not plugin_id or not vote:
return False
url = "http://plugins.qgis.org/plugins/RPC2/"
params = "{\"id\":\"djangorpc\",\"method\":\"plugin.vote\",\"params\":[%s,%s]}" % (str(plugin_id), str(vote))
params = {"id": "djangorpc", "method": "plugin.vote", "params": [str(plugin_id), str(vote)]}
req = QNetworkRequest(QUrl(url))
req.setRawHeader("Content-Type", "application/json")
QgsNetworkAccessManager.instance().post(req, params)
req.setRawHeader(b"Content-Type", b"application/json")
QgsNetworkAccessManager.instance().post(req, bytes(json.dumps(params), "utf-8"))
return True

def installFromZipFile(self, filePath):

0 comments on commit 2b2b653

Please sign in to comment.
You can’t perform that action at this time.