add subscribing and unsubscribing, add post editing
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from flask import url_for, session
|
||||
from flask import url_for, session, request
|
||||
from .models import Posts, Threads
|
||||
from .auth import is_logged_in
|
||||
import time
|
||||
|
||||
def get_post_url(post_id, _anchor=False, external=False):
|
||||
post = Posts.find({'id': post_id})
|
||||
@@ -24,3 +25,9 @@ def get_csrf_token():
|
||||
|
||||
def csrf_input():
|
||||
return f'<input type="hidden" name="csrf" value="{get_csrf_token()}">'
|
||||
|
||||
def get_form_checkbox(name: str) -> bool:
|
||||
return request.form.get(name, None) == 'on'
|
||||
|
||||
def time_now() -> int:
|
||||
return int(time.time())
|
||||
|
||||
Reference in New Issue
Block a user