mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 21:27:49 +02:00
Refactor rolling stock
This commit is contained in:
@@ -16,9 +16,7 @@ def addresschecker(f):
|
||||
Check if DCC address does exist in the database
|
||||
"""
|
||||
def addresslookup(request, address, *args):
|
||||
try:
|
||||
RollingStock.objects.get(address=address)
|
||||
except RollingStock.DoesNotExist:
|
||||
if not RollingStock.objects.filter(address=address):
|
||||
raise Http404
|
||||
return f(request, address, *args)
|
||||
return addresslookup
|
||||
|
Reference in New Issue
Block a user