forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2021-10-02 13:34:37 +02:00
parent 9f752bc0bd
commit 9fe1b0bda6
9 changed files with 26 additions and 29 deletions

View File

@ -37,7 +37,7 @@ class OauthApp(Base):
def permalink(self): return f"/admin/app/{self.id}" def permalink(self): return f"/admin/app/{self.id}"
@lazy @lazy
def idlist(self, page=1, **kwargs): def idlist(self, page=1):
posts = g.db.query(Submission.id).options(lazyload('*')).filter_by(app_id=self.id) posts = g.db.query(Submission.id).options(lazyload('*')).filter_by(app_id=self.id)
@ -48,7 +48,7 @@ class OauthApp(Base):
return [x[0] for x in posts.all()] return [x[0] for x in posts.all()]
@lazy @lazy
def comments_idlist(self, page=1, **kwargs): def comments_idlist(self, page=1):
posts = g.db.query(Comment.id).options(lazyload('*')).filter_by(app_id=self.id) posts = g.db.query(Comment.id).options(lazyload('*')).filter_by(app_id=self.id)

View File

@ -69,7 +69,7 @@ def get_account(id, v=None):
return user return user
def get_post(i, v=None, graceful=False, **kwargs): def get_post(i, v=None, graceful=False):
if v: if v:
vt = g.db.query(Vote).options(lazyload('*')).filter_by( vt = g.db.query(Vote).options(lazyload('*')).filter_by(
@ -156,7 +156,7 @@ def get_posts(pids, v=None):
return sorted(output, key=lambda x: pids.index(x.id)) return sorted(output, key=lambda x: pids.index(x.id))
def get_comment(i, v=None, graceful=False, **kwargs): def get_comment(i, v=None, graceful=False):
if v: if v:

View File

@ -5,10 +5,10 @@ from sqlalchemy.sql.expression import FromClause
class values(FromClause): class values(FromClause):
named_with_column = True named_with_column = True
def __init__(self, columns, *args, **kw): def __init__(self, columns, *args, **kwargs):
self._column_args = columns self._column_args = columns
self.list = args self.list = args
self.alias_name = self.name = kw.pop('alias_name', None) self.alias_name = self.name = kwargs.pop('alias_name', None)
def _populate_column_collection(self): def _populate_column_collection(self):
for c in self._column_args: for c in self._column_args:
@ -16,7 +16,7 @@ class values(FromClause):
@compiles(values) @compiles(values)
def compile_values(element, compiler, asfrom=False, **kw): def compile_values(element, compiler, asfrom=False):
columns = element.columns columns = element.columns
v = "VALUES %s" % ", ".join( v = "VALUES %s" % ", ".join(
"(%s)" % ", ".join( "(%s)" % ", ".join(

View File

@ -151,7 +151,7 @@ def front_all(v):
@cache.memoize(timeout=86400) @cache.memoize(timeout=86400)
def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='', **kwargs): def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words=''):
posts = g.db.query(Submission.id).options(lazyload('*')) posts = g.db.query(Submission.id).options(lazyload('*'))
@ -255,7 +255,7 @@ def changelog(v):
@cache.memoize(timeout=86400) @cache.memoize(timeout=86400)
def changeloglist(v=None, sort="new", page=1 ,t="all", **kwargs): def changeloglist(v=None, sort="new", page=1 ,t="all"):
posts = g.db.query(Submission.id).options(lazyload('*')).filter_by(is_banned=False, private=False,).filter(Submission.deleted_utc == 0) posts = g.db.query(Submission.id).options(lazyload('*')).filter_by(is_banned=False, private=False,).filter(Submission.deleted_utc == 0)
@ -319,7 +319,7 @@ def random_post(v):
return redirect(f"/post/{post.id}") return redirect(f"/post/{post.id}")
@cache.memoize(timeout=86400) @cache.memoize(timeout=86400)
def comment_idlist(page=1, v=None, nsfw=False, sort="new", t="all", **kwargs): def comment_idlist(page=1, v=None, nsfw=False, sort="new", t="all"):
posts = g.db.query(Submission).options(lazyload('*')) posts = g.db.query(Submission).options(lazyload('*'))
cc_idlist = [x[0] for x in g.db.query(Submission.id).options(lazyload('*')).filter(Submission.club == True).all()] cc_idlist = [x[0] for x in g.db.query(Submission.id).options(lazyload('*')).filter(Submission.club == True).all()]

View File

@ -216,13 +216,13 @@ def api(v):
return render_template("api.html", v=v) return render_template("api.html", v=v)
@app.get("/contact") @app.get("/contact")
@auth_desired @auth_required
def contact(v): def contact(v):
return render_template("contact.html", v=v) return render_template("contact.html", v=v)
@app.post("/contact") @app.post("/contact")
@auth_desired @auth_required
def submit_contact(v): def submit_contact(v):
message = f'This message has been sent automatically to all admins via https://{site}/contact, user email is "{v.email}"\n\nMessage:\n\n' + request.values.get("message", "") message = f'This message has been sent automatically to all admins via https://{site}/contact, user email is "{v.email}"\n\nMessage:\n\n' + request.values.get("message", "")
send_admin(v.id, message) send_admin(v.id, message)

View File

@ -47,10 +47,6 @@
</form> </form>
{% elif v and v.is_suspended %}
<p>Your {{'SITE_NAME' | app_config}} account has been suspended. You are not permitted to use this form.</p>
{% elif v %} {% elif v %}

View File

@ -47,15 +47,6 @@
{% include "expanded_image_modal.html" %} {% include "expanded_image_modal.html" %}
{% endif %} {% endif %}
{% if v and v.id==p.author_id %}
{% include "delete_post_modal.html" %}
{% endif %}
{% if v %}
{% include "report_post_modal.html" %}
{% endif %}
{% if p.award_count("shit") %} {% if p.award_count("shit") %}
<script src="/assets/js/bug-min.js"></script> <script src="/assets/js/bug-min.js"></script>
{% set minbugs = 10*p.award_count("shit") if p.award_count("shit") < 3 else 20 %} {% set minbugs = 10*p.award_count("shit") if p.award_count("shit") < 3 else 20 %}
@ -725,4 +716,13 @@
})() })()
</script> </script>
{% if v and v.id==p.author_id %}
{% include "delete_post_modal.html" %}
{% endif %}
{% if v %}
{% include "report_post_modal.html" %}
{% endif %}
{% endblock %} {% endblock %}

View File

@ -1083,6 +1083,7 @@ You also spend quite a lot of time examining and excoriating my initial statemen
I can only conclude you're a narcissist and an abuser, because no one else would attempt to twist words to this extent, and write so much to try and dissect each individual sentence. I can only conclude you're a narcissist and an abuser, because no one else would attempt to twist words to this extent, and write so much to try and dissect each individual sentence.
{[para]} {[para]}
He is worse than a Jew, he is—may Allah forgive me for saying this—a SRDine. He is worse than a Jew, he is—may Allah forgive me for saying this—a SRDine.
{[para]}
Side note: it's a function of that testosterone crippled brain that you are so focused on dicks, and your own dick in particular. Guess what? Take estrogen for a while and you will lose focus on that body part to the point where it doesn't even matter anymore. There is so much more to being a woman that genitals, like the depth and complexity of emotions and bonding with others in ways that are literally incomprehensible to you. Side note: it's a function of that testosterone crippled brain that you are so focused on dicks, and your own dick in particular. Guess what? Take estrogen for a while and you will lose focus on that body part to the point where it doesn't even matter anymore. There is so much more to being a woman that genitals, like the depth and complexity of emotions and bonding with others in ways that are literally incomprehensible to you.
{[para]} {[para]}
You may like gobbling up the same shit content, that doesn't mean the rest of us need to like your shit sandwich. You may like gobbling up the same shit content, that doesn't mean the rest of us need to like your shit sandwich.