diff --git a/core/models/caves.py b/core/models/caves.py index 0b11926..997bbdb 100644 --- a/core/models/caves.py +++ b/core/models/caves.py @@ -132,7 +132,7 @@ class Cave(TroggleModel): # pass # else: # self.official_name.lower() - return self.url # not good Django style? NEEDS actual URL + return "/"+ self.url # not good Django style? NEEDS actual URL def url_parent(self): if self.url: @@ -378,8 +378,9 @@ class Entrance(TroggleModel): return self.findability != "S" or not self.has_photo or self.marking != "T" def get_absolute_url(self): + # This can't be right.. res = "/".join((self.get_root().cave.get_absolute_url(), self.title)) - return res + return self.url_parent() def cavelist(self): rs = [] @@ -737,20 +738,8 @@ def update_dataissue(parsercode, message): # bollocks, swallow this.DANGEROUS. Assuming this is the # (1406, "Data too long for column 'message' at row1") # fault in the mariaDb/Django setup. + exept_msg = f"Is this the (1406, Data too long for column 'message' at row1) problem?\nexception:{e}" raise except: - # Complete bollocks, but MariaDB barfs when it shouldn't : Django 3.2 - issues = DataIssue.objects.filter(parser=parsercode, message=message) - - print(f" # EXCEPTION looking for DataIssue '{parsercode}' {message})") - if len(issues) > 1: - print(f" # MULTIPLE DataIssues '{parsercode}' {message}") - for s in issues: - print(f" # {s.id=} DataIssues '{parsercode}' {message}") # .id is Django internal field, not one of ours - message = "#2 " + message - if len(issues) > 0: - i = issues[0] - i.message = message - i.save() - else: - DataIssue.objects.create(parser=parsercode, message=message) \ No newline at end of file + # never mind, make a duplicate + DataIssue.objects.create(parser=parsercode, message=message) \ No newline at end of file diff --git a/templates/logbookentry.html b/templates/logbookentry.html index e15cec3..3d1a49e 100644 --- a/templates/logbookentry.html +++ b/templates/logbookentry.html @@ -13,7 +13,7 @@

{% if logbookentry.cave %} -

place: {{logbookentry.place|safe}}

+

place: {{logbookentry.place|safe}}

{% else %}

{{logbookentry.place|safe}}

{% endif %}