diff --git a/server/urls.py b/server/urls.py index 86d49f0..729eacb 100755 --- a/server/urls.py +++ b/server/urls.py @@ -13,7 +13,8 @@ url(r'^info/secret/(?P.+)/', secret_info, name='secret_info'), #computerinfo - url(r'^info/(?P.+)/', computer_info, name='computer_info'), + url(r'^info/(?P[0-9]+)/', computer_info, name='computer_info'), + url(r'^info/(?P[A-Z0-9]{11,12}.+)/', computer_info, name='computer_info'), #request url(r'^request/(?P.+)/', request, name='request'), diff --git a/server/views.py b/server/views.py index 31090e0..7531953 100644 --- a/server/views.py +++ b/server/views.py @@ -50,9 +50,12 @@ def index(request): ##view to see computer info @login_required -def computer_info(request, computer_id): +def computer_info(request, computer_id=None, serial=None): cleanup() - computer = get_object_or_404(Computer, pk=computer_id) + if computer_id: + computer = get_object_or_404(Computer, pk=computer_id) + else: + computer = get_object_or_404(Computer, serial=serial) can_request = None approved = None