From e826a195650c210bdd2ba827c451953ef33e61e8 Mon Sep 17 00:00:00 2001 From: xenua Date: Sun, 19 Jun 2022 16:59:57 +0200 Subject: [PATCH] fix a thing --- leftists/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/leftists/models.py b/leftists/models.py index 1037a00..35d94b6 100644 --- a/leftists/models.py +++ b/leftists/models.py @@ -37,9 +37,9 @@ class ShortLink(RandomSlugPKMixin, models.Model): return f"{self.domain.fqdn}/{self.location}" @classmethod - def get_from_request(cls, req): + def get_from_request(cls, req, loc): d = Domain.get_from_request(req) - return cls.objects.filter(domain=d).get(location=req.path[1:]) + return cls.objects.filter(domain=d).get(location=loc) @classmethod def hit(cls, req, loc): @@ -50,7 +50,7 @@ class ShortLink(RandomSlugPKMixin, models.Model): @classmethod def miss(cls, req, loc): - lnk = cls.get_from_request(req) + lnk = cls.get_from_request(req, loc) cls.cache[req.get_host()][loc] = lnk.to return lnk.to