[FIX] Attempting to fix

This commit is contained in:
Arnold Dechamps 2024-08-02 23:13:13 +02:00
parent df30c71a64
commit 18c0c3f019
No known key found for this signature in database
GPG key ID: AE66543374E41C89

View file

@ -60,14 +60,14 @@ def webrequest(tld, stack):
def dbwriter(intld, stack, measurement):
tld = Atlas.objects.filter(tld=intld)
tld = Atlas.objects.filter(unicodetld=intld)
tldstack = tld.filter(stack=stack)
if tldstack.exists():
primary_key = tldstack.values_list('pk', flat=True).first()
db = Atlas.objects.get(pk=primary_key)
else:
db = Atlas()
db.tld = intld
db.unicodetld = intld
db.stack = stack
if measurement is not None:
db.measurement = measurement
@ -93,9 +93,9 @@ def main():
tlds = TLD.objects.all().order_by('tld')
for tld in tlds:
db = TLD.objects.get(tld=tld)
tlds.append(db.tld)
tldslist.append(db.tld)
for tld in tldslist:
db = TLD.objects.get(tld=tld)
db = TLD.objects.get(unicodetld=tld)
if db.atlasv4 is None:
webrequest(tld, 4)
if db.atlasv6 is None: