Generalize pretixdroid settings UI

This commit is contained in:
Raphael Michel
2018-01-06 22:45:32 +01:00
parent f054e700a2
commit f65f166ea6
9 changed files with 148 additions and 58 deletions

View File

@@ -1,5 +1,6 @@
import json
import logging
import urllib.parse
import dateutil.parser
from django.contrib import messages
@@ -59,13 +60,16 @@ class ConfigCodeView(EventPermissionRequiredMixin, TemplateView):
'subevent': self.object.subevent.pk
})
ctx['qrdata'] = json.dumps({
data = {
'version': API_VERSION,
'url': url[:-7], # the slice removes the redeem/ part at the end
'key': self.object.key,
'allow_search': self.object.allow_search,
'show_info': self.object.show_info
})
}
ctx['config'] = self.object
ctx['query'] = urllib.parse.urlencode(data, safe=':/')
ctx['qrdata'] = json.dumps(data)
return ctx