Merge pull request #6 from ilianaw/default-to-visible

Default to visible if visible_in_picker missing
This commit is contained in:
iliana weller 2018-07-25 22:21:05 -04:00
commit 51100c654f
No known key found for this signature in database
GPG Key ID: DCE341C8E949BC81
1 changed files with 1 additions and 1 deletions

View File

@ -28,7 +28,7 @@ def emojo(domain):
try: try:
url = urllib.parse.urlunsplit( url = urllib.parse.urlunsplit(
('https', domain, '/api/v1/custom_emojis', '', '')) ('https', domain, '/api/v1/custom_emojis', '', ''))
emojo = sorted(filter(lambda x: x['visible_in_picker'], emojo = sorted(filter(lambda x: x.get('visible_in_picker', True),
requests.get(url).json()), requests.get(url).json()),
key=operator.itemgetter('shortcode')) key=operator.itemgetter('shortcode'))
return render_template('emojo.html', domain=domain, emojo=emojo) return render_template('emojo.html', domain=domain, emojo=emojo)