from django.views.decorators.csrf import csrf_exempt
from django.views.generic import ListView, CreateView, DeleteView
from services.models import Service
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import ListView, CreateView, DeleteView
from services.models import Service
key = request.GET.get('key')
service = get_object_or_404(Service, key=key)
n = now()
key = request.GET.get('key')
service = get_object_or_404(Service, key=key)
n = now()
- key = data['algo'], data['md5']
+ algo = data['algo']
+ if 'md5' in data:
+ hash_type = 'md5'
+ hash_value = data['md5']
+ else:
+ hash_type = 'sha256'
+ hash_value = data['sha256']
+ key = algo, hash_type, hash_value
last_seen[key] = max(last_seen.get(key, dt), dt)
for key, dt in last_seen.items():
last_seen[key] = max(last_seen.get(key, dt), dt)
for key, dt in last_seen.items():