ha... ha... One day I'll get good at testing
This commit is contained in:
parent
b4961d6213
commit
82f97cce0d
|
@ -15,7 +15,7 @@ class RedirectConverter:
|
||||||
regex='.*'
|
regex='.*'
|
||||||
def to_python(self,value):
|
def to_python(self,value):
|
||||||
try: r=Redirect.objects.get(match=value)
|
try: r=Redirect.objects.get(match=value)
|
||||||
except Page.DoesNotExist: raise ValueError(f'No such redirect {value}')
|
except Redirect.DoesNotExist: raise ValueError(f'No such redirect {value}')
|
||||||
if not r: raise ValueError(f'No such redirect {value}')
|
if not r: raise ValueError(f'No such redirect {value}')
|
||||||
return r
|
return r
|
||||||
def to_url(self,value):
|
def to_url(self,value):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user