Simplify oembed dict missing key fallback (#6922)

pull/7215/head
Jaap Roes 2021-05-24 18:20:13 +02:00 zatwierdzone przez GitHub
rodzic 0dfc342d66
commit 8487c67ebb
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -72,9 +72,9 @@ class OEmbedFinder(EmbedFinder):
# Return embed as a dict
return {
'title': oembed['title'] if 'title' in oembed else '',
'author_name': oembed['author_name'] if 'author_name' in oembed else '',
'provider_name': oembed['provider_name'] if 'provider_name' in oembed else '',
'title': oembed.get('title', ''),
'author_name': oembed.get('author_name', ''),
'provider_name': oembed.get('provider_name', ''),
'type': oembed['type'],
'thumbnail_url': oembed.get('thumbnail_url'),
'width': oembed.get('width'),