2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-22 07:11:52 +00:00

another attempt to avoid non-null parent pseudo error

This commit is contained in:
Philip Sargent 2022-07-19 20:00:35 +03:00
parent 1395ac76e9
commit d9d75b3aee

View File

@ -170,10 +170,11 @@ def readcaves():
DataIssue.objects.filter(parser='caves ok').delete()
DataIssue.objects.filter(parser='entrances').delete()
area_1623, state = Area.objects.update_or_create(short_name = "1623", parent = None)
# This seems to return a tuple, not a single object! i.e. (<Area: 1623>, True)
print(" - Creating Areas 1623 and 1626")
# This crashes on the server with MariaDB even though a null parent is explicitly allowed.
area_1623, state = Area.objects.update_or_create(short_name = "1623")
#print(f' ! - READ CAVES: {area_1623}')
area_1626, state = Area.objects.update_or_create(short_name = "1626", parent = None)
area_1626, state = Area.objects.update_or_create(short_name = "1626")
print (" - Setting pending caves")
# Do this first, so that these empty entries are overwritten as they get properly created.