Skip to content

Commit c687077

Browse files
committedJan 22, 2018
fix sending plugin votes
1 parent 936c30b commit c687077

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎python/pyplugin_installer/installer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
* *
2323
***************************************************************************/
2424
"""
25-
from builtins import str
2625

2726
import os
27+
import json
2828
import zipfile
2929

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

534534
def installFromZipFile(self, filePath):

0 commit comments

Comments
 (0)
Please sign in to comment.