StopIterator has been depreciated, use return [PEP479]

https://www.python.org/dev/peps/pep-0479/#consequences-for-existing-code
This commit is contained in:
Andrew Fyfe
2017-12-19 00:50:52 +00:00
parent e6befb3de9
commit 3308c56480
+2 -2
View File
@@ -37,14 +37,14 @@ class MXRecordManager(models.Manager):
if records.exists():
for record in records:
yield record
raise StopIteration()
return
self.get_queryset().filter(domain=domain).delete()
delta = datetime.timedelta(seconds=ttl)
domain_mxs = lib.get_domain_mx_list(domain.name)
if len(domain_mxs) == 0:
raise StopIteration
return
for mx_addr, mx_ip_addr in domain_mxs:
record = self.get_queryset().create(
domain=domain,