Better framework for banning
This commit is contained in:
parent
48a54a88aa
commit
c2048f9259
2 changed files with 3 additions and 1 deletions
|
@ -8,6 +8,7 @@ DATABASE_URI = 'sqlite:///' + os.path.join(BASE_DIR, 'server', 'mapsme-changes.d
|
|||
|
||||
PAGE_SIZE = 100
|
||||
TOP = 10
|
||||
BAN_USERS = set([481934])
|
||||
|
||||
# See https://github.com/Zverik/queryat
|
||||
# Example: 'http://localhost:5000/queryat/'
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
import urllib2, re, gzip, json
|
||||
import config
|
||||
from db import *
|
||||
from lxml import etree
|
||||
from StringIO import StringIO
|
||||
|
@ -26,7 +27,7 @@ def download_last_state():
|
|||
|
||||
def filter_changeset(changeset):
|
||||
"""A changeset object is a dict of tags plus 'id', 'timestamp' and 'user' fields."""
|
||||
if changeset['uid'] == 481934: # Ban iWowik
|
||||
if changeset['uid'] in config.BAN_USERS:
|
||||
return False
|
||||
return 'created_by' in changeset and changeset['created_by'][:7] == 'MAPS.ME' and 'JOSM' not in changeset['created_by']
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue