Skip to content

Commit ed196cb

Browse files
committed
Merge pull request OpenTreeMap#148 from ahinz/topic/config-recent-edits
Make recent edits by admins configurable
2 parents fa09e0f + 6c66066 commit ed196cb

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

settings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
# as company.com
3737
FORCE_MAIL_TO_BE_FROM = None
3838

39+
SHOW_ADMIN_EDITS_IN_RECENT_EDITS = False
40+
3941
DEBUG = True
4042

4143
INSTALLED_APPS = (

treemap/views.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,10 +1796,30 @@ def clean_key_names(jsonstr):
17961796
def verify_edits(request, audit_type='tree'):
17971797

17981798
changes = []
1799-
trees = Tree.history.filter(present=True).filter(_audit_user_rep__lt=1000).filter(_audit_change_type__exact='U').exclude(_audit_diff__exact='').filter(_audit_verified__exact=0)
1800-
newtrees = Tree.history.filter(present=True).filter(_audit_user_rep__lt=1000).filter(_audit_change_type__exact='I').filter(_audit_verified__exact=0)
1801-
plots = Plot.history.filter(present=True).filter(_audit_user_rep__lt=1000).filter(_audit_change_type__exact='U').exclude(_audit_diff__exact='').filter(_audit_verified__exact=0)
1802-
newplots = Plot.history.filter(present=True).filter(_audit_user_rep__lt=1000).filter(_audit_change_type__exact='I').filter(_audit_verified__exact=0)
1799+
trees = Tree.history.filter(present=True)\
1800+
.filter(_audit_change_type__exact='U')\
1801+
.exclude(_audit_diff__exact='')\
1802+
.filter(_audit_verified__exact=0)
1803+
1804+
newtrees = Tree.history.filter(present=True)\
1805+
.filter(_audit_change_type__exact='I')\
1806+
.filter(_audit_verified__exact=0)
1807+
1808+
plots = Plot.history.filter(present=True)\
1809+
.filter(_audit_change_type__exact='U')\
1810+
.exclude(_audit_diff__exact='')\
1811+
.filter(_audit_verified__exact=0)
1812+
1813+
newplots = Plot.history.filter(present=True)\
1814+
.filter(_audit_change_type__exact='I')\
1815+
.filter(_audit_verified__exact=0)
1816+
1817+
if settings.SHOW_ADMIN_EDITS_IN_RECENT_EDITS is False:
1818+
trees = trees.filter(_audit_user_rep__lt=1000)
1819+
newtrees = newtrees.filter(_audit_user_rep__lt=1000)
1820+
plots = plots.filter(_audit_user_rep__lt=1000)
1821+
newplots = newplots.filter(_audit_user_rep__lt=1000)
1822+
18031823
treeactions = []
18041824
n = None
18051825

0 commit comments

Comments
 (0)