added spam removal

This commit is contained in:
2019-07-10 19:31:11 +01:00
parent 1067b4fc3b
commit 8db931a4c7
2 changed files with 31 additions and 6 deletions

View File

@@ -4,3 +4,10 @@ def remove_common_elements(a, b):
if e in b:
a.remove(e)
b.remove(e)
def get_ip(request):
if request.headers.getlist("X-Forwarded-For"):
return request.headers.getlist("X-Forwarded-For")[0]
else:
return request.remote_addr