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: %else: @@ -73,7 +73,7 @@ ${captchagen(thing.iden, thing.error)} %if show_error: ${error_field("BAD_CAPTCHA", "span")} %endif - %if tabulatar: + %if tabular: %endif diff --git a/r2/r2/templates/createsubreddit.html b/r2/r2/templates/createsubreddit.html index 065980c00..554abbb59 100644 --- a/r2/r2/templates/createsubreddit.html +++ b/r2/r2/templates/createsubreddit.html @@ -63,7 +63,7 @@ function update_title() { %endif
+ onsubmit="return post_form(this, 'site_admin', null, null, true)"> %if thing.site: %endif diff --git a/r2/r2/templates/login.html b/r2/r2/templates/login.html index 8ecbfb4f7..19fba990a 100644 --- a/r2/r2/templates/login.html +++ b/r2/r2/templates/login.html @@ -1,4 +1,4 @@ -## "The contents of this file are subject to the Common Public Attribution +## The contents of this file are subject to the Common Public Attribution ## License Version 1.0. (the "License"); you may not use this file except in ## compliance with the License. You may obtain a copy of the License at ## http://code.reddit.com/LICENSE. The License is based on the Mozilla Public diff --git a/r2/r2/templates/loginformwide.html b/r2/r2/templates/loginformwide.html index 8e1e5862a..9a8345c58 100644 --- a/r2/r2/templates/loginformwide.html +++ b/r2/r2/templates/loginformwide.html @@ -1,4 +1,4 @@ -## "The contents of this file are subject to the Common Public Attribution +## The contents of this file are subject to the Common Public Attribution ## License Version 1.0. (the "License"); you may not use this file except in ## compliance with the License. You may obtain a copy of the License at ## http://code.reddit.com/LICENSE. The License is based on the Mozilla Public @@ -28,17 +28,17 @@ + type="text" maxlength="20" tabindex="1"/> + type="password" maxlength="20" tabindex="2"/> ${error_field("WRONG_PASSWORD_" + op, "div")}
- - ${_("login")} +