Skip to content

Commit f0e610c

Browse files
committed
Test: fix tests to check for None first
1 parent 6c6d1b9 commit f0e610c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

readthedocs/api/v2/views/integrations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ def handle_webhook(self):
431431
(created or deleted),
432432
]):
433433
integration = self.get_integration()
434-
events = integration.provider_data.get('events', [])
434+
events = integration.provider_data.get('events', []) if integration.provider_data else []
435435
if any([
436436
GITHUB_CREATE in events,
437437
GITHUB_DELETE in events,

readthedocs/builds/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ def config(self):
738738
# probably change this field to be a ForeignKey to avoid repeating the
739739
# config file over and over again and re-use them to save db data as
740740
# well
741-
if self.CONFIG_KEY in self._config:
741+
if self._config and self.CONFIG_KEY in self._config:
742742
return (
743743
Build.objects
744744
.only('_config')

0 commit comments

Comments
 (0)