diff --git a/core/models_caves.py b/core/models_caves.py index b3520b7..87138e2 100644 --- a/core/models_caves.py +++ b/core/models_caves.py @@ -122,7 +122,7 @@ class Cave(TroggleModel): else: href = self.official_name.lower() #return settings.URL_ROOT + '/cave/' + href + '/' - return urllib.parse.urljoin(settings.URL_ROOT, reverse('cave',kwargs={'cave_id':href,})) + return urljoin(settings.URL_ROOT, reverse('cave',kwargs={'cave_id':href,})) def __str__(self, sep = ": "): return str("slug:"+self.slug()) @@ -387,7 +387,7 @@ class CaveDescription(TroggleModel): return str(self.short_name) def get_absolute_url(self): - return urllib.parse.urljoin(settings.URL_ROOT, reverse('cavedescription', args=(self.short_name,))) + return urljoin(settings.URL_ROOT, reverse('cavedescription', args=(self.short_name,))) def save(self): """ @@ -458,7 +458,7 @@ class LogbookEntry(TroggleModel): return True def get_absolute_url(self): - return urllib.parse.urljoin(settings.URL_ROOT, reverse('logbookentry',kwargs={'date':self.date,'slug':self.slug})) + return urljoin(settings.URL_ROOT, reverse('logbookentry',kwargs={'date':self.date,'slug':self.slug})) def __str__(self): return "%s: (%s)" % (self.date, self.title) @@ -518,7 +518,7 @@ class QM(TroggleModel): def get_absolute_url(self): #return settings.URL_ROOT + '/cave/' + self.found_by.cave.kataster_number + '/' + str(self.found_by.date.year) + '-' + '%02d' %self.number - return urllib.parse.urljoin(settings.URL_ROOT, reverse('qm',kwargs={'cave_id':self.found_by.cave.kataster_number,'year':self.found_by.date.year,'qm_id':self.number,'grade':self.grade})) + return urljoin(settings.URL_ROOT, reverse('qm',kwargs={'cave_id':self.found_by.cave.kataster_number,'year':self.found_by.date.year,'qm_id':self.number,'grade':self.grade})) def get_next_by_id(self): return QM.objects.get(id=self.id+1)