diff --git a/r2/r2/controllers/api.py b/r2/r2/controllers/api.py index e464bcc1d..22ab96bbb 100644 --- a/r2/r2/controllers/api.py +++ b/r2/r2/controllers/api.py @@ -527,7 +527,7 @@ class ApiController(RedditController): def POST_editcomment(self, res, comment, body): res._update('status_' + comment._fullname, innerHTML = '') - if res._chk_errors((errors.BAD_COMMENT, errors.COMMENT_TOO_LONG, errors.NOT_AUTHOR), + if not res._chk_errors((errors.BAD_COMMENT,errors.COMMENT_TOO_LONG,errors.NOT_AUTHOR), comment._fullname): comment.body = body if not c.user_is_admin: comment.editted = True diff --git a/r2/r2/lib/pages/pages.py b/r2/r2/lib/pages/pages.py index 60d0b2279..a0724a5d0 100644 --- a/r2/r2/lib/pages/pages.py +++ b/r2/r2/lib/pages/pages.py @@ -470,7 +470,7 @@ class SubredditsPage(Reddit): takes the same arguments as SearchBar, which it uses to construct self.searchbar""" searchbox = False - + submit_box = False def __init__(self, prev_search = '', num_results = 0, elapsed_time = 0, title = '', loginbox = True, infotext = None, *a, **kw): Reddit.__init__(self, title = title, loginbox = loginbox, infotext = infotext, diff --git a/r2/r2/models/report.py b/r2/r2/models/report.py index e6e9a4ec9..05b4310bc 100644 --- a/r2/r2/models/report.py +++ b/r2/r2/models/report.py @@ -72,9 +72,10 @@ class Report(MultiRelation('report', thing._incr(cls._field) # mark author as reported - aid = thing.author_id - author = Account._byID(aid) - author._incr(cls._field) + if hasattr(thing, 'author_id'): + aid = thing.author_id + author = Account._byID(aid) + author._incr(cls._field) # mark user as having made a report user._incr('report_made') @@ -104,8 +105,9 @@ class Report(MultiRelation('report', for a in set((old_amount, amount, None)): # clear memoizing around this thing's author if not r._thing2._loaded: r._thing2._load() - clear_memo('report._by_author', cls, r._thing2.author_id, - amount = a) + if hasattr(r._thing2, "author_id"): + clear_memo('report._by_author', cls, r._thing2.author_id, + amount = a) for t in (r._thing1, r._thing2): thing_key = cls._cache_prefix(rel, t.__class__, @@ -144,10 +146,11 @@ class Report(MultiRelation('report', # update the author and thing field if getattr(r._thing2, Report._field) > 0: r._thing2._incr(Report._field, -1) - aid = r._thing2.author_id - author = Account._byID(aid) - if getattr(author, Report._field) > 0: - author._incr(Report._field, -1) + if hasattr(r._thing2, "author_id"): + aid = r._thing2.author_id + author = Account._byID(aid) + if getattr(author, Report._field) > 0: + author._incr(Report._field, -1) admintools.report(r._thing2, -1) diff --git a/r2/r2/templates/captcha.html b/r2/r2/templates/captcha.html index 564e97f5b..44ff4bac8 100644 --- a/r2/r2/templates/captcha.html +++ b/r2/r2/templates/captcha.html @@ -64,7 +64,7 @@ ${captchagen(thing.iden, thing.error)} - %if tabulatar: + %if tabular: