Commit 5b0e6618 authored by Stauros Kroustouris's avatar Stauros Kroustouris

remove code used only for development

parent ced1a876
......@@ -56,7 +56,7 @@ Here are some examples:
- Retrieve a specific rule:
curl -X GET https:/fod.example.com/api/routes/<rule_id>/ -H 'Authorization: Token <Your users token>'
curl -X GET https://fod.example.com/api/routes/<rule_id>/ -H 'Authorization: Token <Your users token>'
- In order to create or modify a rule you have to use POST/PUT methods.
......
......@@ -20,15 +20,13 @@ from flowspec.serializers import (
from rest_framework.response import Response
from django.contrib.auth.models import User
class RouteViewSet(viewsets.ModelViewSet):
queryset = Route.objects.all()
serializer_class = RouteSerializer
def get_queryset(self):
if self.request.user.is_anonymous or self.request.user.is_superuser:
if self.request.user.is_superuser:
return Route.objects.all()
else:
return Route.objects.filter(applier=self.request.user)
......@@ -43,9 +41,6 @@ class RouteViewSet(viewsets.ModelViewSet):
return Response(serializer.data)
def pre_save(self, obj):
if self.request.user.is_anonymous:
obj.applier = User.objects.all()[0]
else:
obj.applier = self.request.user
......
// If the user clicks on Generate token,
// then the following function will ask django
// for a token and then present it
$(document).ready(function() {
$('a#generate_token').one('click', function (ev) {
ev.preventDefault();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment