Merge pull request #9 from atrc445/fix-seed-db
make comments and private messages work without pusher api key
This commit is contained in:
commit
aa7ab261ed
3 changed files with 42 additions and 26 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
import traceback
|
||||||
|
import sys
|
||||||
|
|
||||||
from files.helpers.wrappers import *
|
from files.helpers.wrappers import *
|
||||||
from files.helpers.filters import *
|
from files.helpers.filters import *
|
||||||
from files.helpers.alerts import *
|
from files.helpers.alerts import *
|
||||||
|
@ -5,7 +8,7 @@ from files.helpers.images import *
|
||||||
from files.helpers.session import *
|
from files.helpers.session import *
|
||||||
from files.classes import *
|
from files.classes import *
|
||||||
from files.routes.front import comment_idlist
|
from files.routes.front import comment_idlist
|
||||||
from pusher_push_notifications import PushNotifications
|
from pusher_push_notifications import PushNotifications, PusherAuthError
|
||||||
|
|
||||||
from flask import *
|
from flask import *
|
||||||
from files.__main__ import app, limiter
|
from files.__main__ import app, limiter
|
||||||
|
@ -530,6 +533,7 @@ def api_comment(v):
|
||||||
except: g.db.rollback()
|
except: g.db.rollback()
|
||||||
|
|
||||||
if parent.author.id != v.id:
|
if parent.author.id != v.id:
|
||||||
|
try:
|
||||||
beams_client.publish_to_interests(
|
beams_client.publish_to_interests(
|
||||||
interests=[str(parent.author.id)],
|
interests=[str(parent.author.id)],
|
||||||
publish_body={
|
publish_body={
|
||||||
|
@ -542,6 +546,10 @@ def api_comment(v):
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
except PusherAuthError as e:
|
||||||
|
sys.stderr.write(traceback.format_exc())
|
||||||
|
sys.stderr.flush()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
import qrcode
|
import qrcode
|
||||||
import io
|
import io
|
||||||
import time
|
import time
|
||||||
|
import traceback
|
||||||
|
import sys
|
||||||
|
|
||||||
from files.classes.user import ViewerRelationship
|
from files.classes.user import ViewerRelationship
|
||||||
from files.helpers.alerts import *
|
from files.helpers.alerts import *
|
||||||
|
@ -9,7 +11,7 @@ from files.helpers.markdown import *
|
||||||
from files.mail import *
|
from files.mail import *
|
||||||
from flask import *
|
from flask import *
|
||||||
from files.__main__ import app, limiter
|
from files.__main__ import app, limiter
|
||||||
from pusher_push_notifications import PushNotifications
|
from pusher_push_notifications import PushNotifications, PusherAuthError
|
||||||
|
|
||||||
site = environ.get("DOMAIN").strip()
|
site = environ.get("DOMAIN").strip()
|
||||||
|
|
||||||
|
@ -142,6 +144,8 @@ def message2(v, username):
|
||||||
if existing: return redirect('/notifications?all=true')
|
if existing: return redirect('/notifications?all=true')
|
||||||
|
|
||||||
send_pm(v.id, user, message)
|
send_pm(v.id, user, message)
|
||||||
|
|
||||||
|
try:
|
||||||
beams_client.publish_to_interests(
|
beams_client.publish_to_interests(
|
||||||
interests=[str(user.id)],
|
interests=[str(user.id)],
|
||||||
publish_body={
|
publish_body={
|
||||||
|
@ -154,6 +158,10 @@ def message2(v, username):
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
except PusherAuthError as e:
|
||||||
|
sys.stderr.write(traceback.format_exc())
|
||||||
|
sys.stderr.flush()
|
||||||
|
|
||||||
return redirect('/notifications?all=true')
|
return redirect('/notifications?all=true')
|
||||||
|
|
||||||
@app.get("/2faqr/<secret>")
|
@app.get("/2faqr/<secret>")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue