Merge branch 'master' of github.com:nsupdate-info/nsupdate.info
This commit is contained in:
commit
1de8a9aaf6
23
nsupdate/accounts/migrations/0002_auto_20141125_2325.py
Normal file
23
nsupdate/accounts/migrations/0002_auto_20141125_2325.py
Normal file
@ -0,0 +1,23 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.contrib.auth import get_user_model
|
||||
|
||||
|
||||
def add_userprofiles(apps, schema_editor):
|
||||
User = apps.get_model("auth", "User")
|
||||
UserProfile = apps.get_model("accounts", "UserProfile")
|
||||
for user in User.objects.all():
|
||||
UserProfile.objects.get_or_create(user=user)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('accounts', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(add_userprofiles),
|
||||
]
|
@ -216,9 +216,9 @@ def query_ns(fqdn, rdtype):
|
||||
ip = str(list(answer)[0])
|
||||
logger.debug("query: %s answer: %s" % (fqdn, ip))
|
||||
return ip
|
||||
except (dns.resolver.Timeout, dns.resolver.NoNameservers): # socket.error also?
|
||||
logger.warning("timeout when querying for name '%s' in zone '%s' with rdtype '%s'." % (
|
||||
fqdn.host, origin, rdtype))
|
||||
except (dns.resolver.Timeout, dns.resolver.NoNameservers) as e: # socket.error also?
|
||||
logger.warning("error when querying for name '%s' in zone '%s' with rdtype '%s' [%s]." % (
|
||||
fqdn.host, origin, rdtype, str(e)))
|
||||
set_ns_availability(origin, False)
|
||||
raise
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user