Skip to content

Commit

Permalink
Merge pull request #6129 from alexbruy/plugins-rating
Browse files Browse the repository at this point in the history
[plugin manager] fix sending plugin votes
  • Loading branch information
borysiasty authored Jan 22, 2018
2 parents 7a2ab1c + 08255f7 commit 2b2b653
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/pyplugin_installer/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 2b2b653

Please sign in to comment.