mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-01-31 15:32:35 +00:00
Check the url field too
This commit is contained in:
parent
d4cf76da40
commit
cf6ba7568f
@ -648,18 +648,18 @@ def read_cave(filename, cave=None):
|
|||||||
print(message)
|
print(message)
|
||||||
primary = False
|
primary = False
|
||||||
|
|
||||||
def check_slug(areacode, kataster_number, unofficial_number):
|
def check_slug(areacode, kataster_number, unofficial_number, url):
|
||||||
if kataster_number:
|
if kataster_number:
|
||||||
if slug == f"{areacode}-{kataster_number}":
|
if slug == f"{areacode}-{kataster_number}":
|
||||||
return
|
return
|
||||||
message = f" ! Cave Slug incorrect (kataster): '{slug}' != '{areacode}-{kataster_number}' in file {filename}"
|
message = f" ! Cave Slug incorrect (kataster): '{slug}' != '{areacode}-{kataster_number}' {url=} in file {filename}"
|
||||||
else:
|
else:
|
||||||
if slug == f"{areacode}-{unofficial_number}":
|
if slug == f"{areacode}-{unofficial_number}":
|
||||||
return
|
return
|
||||||
message = f" ! Cave Slug incorrect (unofficial): '{slug}' != '{areacode}-{unofficial_number}' in file {filename}"
|
message = f" ! Cave Slug incorrect (unofficial): '{slug}' != '{areacode}-{unofficial_number}' {url=} in file {filename}"
|
||||||
if slug.lower() == f"{areacode}-{unofficial_number.lower()}":
|
if slug.lower() == f"{areacode}-{unofficial_number.lower()}":
|
||||||
message = f" ! Cave Slug capitalisation incorrect (unofficial): {slug} != {areacode}-{unofficial_number} in file {filename}"
|
message = f" ! Cave Slug capitalisation incorrect (unofficial): '{slug}' != '{areacode}-{unofficial_number}' {url=} in file {filename}"
|
||||||
DataIssue.objects.create(parser="caves", message=message, url=f"{cave.url}_cave_edit/")
|
DataIssue.objects.create(parser="caves", message=message, url=f"{cave.slug}_cave_edit/")
|
||||||
print(message)
|
print(message)
|
||||||
|
|
||||||
global entrances_xslug
|
global entrances_xslug
|
||||||
@ -773,7 +773,7 @@ def read_cave(filename, cave=None):
|
|||||||
cave.description_file=description_file[0]
|
cave.description_file=description_file[0]
|
||||||
cave.url=url[0]
|
cave.url=url[0]
|
||||||
|
|
||||||
check_slug(cave.areacode,cave.kataster_number, cave.unofficial_number)
|
check_slug(cave.areacode,cave.kataster_number, cave.unofficial_number, cave.url)
|
||||||
|
|
||||||
entrances = getXML(cavecontents, "entrance", context=context)
|
entrances = getXML(cavecontents, "entrance", context=context)
|
||||||
do_entrances()
|
do_entrances()
|
||||||
|
Loading…
Reference in New Issue
Block a user