mirror of
https://github.com/offen/website.git
synced 2024-11-22 17:10:29 +01:00
stop accepting events from retired account
This commit is contained in:
parent
124fdc82a7
commit
d6e714d1a1
@ -20,7 +20,7 @@ class RemoteServerException(Exception):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def create_remote_account(name, account_id):
|
def create_remote_account(account_id):
|
||||||
# expires in 30 seconds as this will mean the HTTP request would have
|
# expires in 30 seconds as this will mean the HTTP request would have
|
||||||
# timed out anyways
|
# timed out anyways
|
||||||
expiry = datetime.utcnow() + timedelta(seconds=30)
|
expiry = datetime.utcnow() + timedelta(seconds=30)
|
||||||
@ -32,7 +32,7 @@ def create_remote_account(name, account_id):
|
|||||||
|
|
||||||
r = requests.post(
|
r = requests.post(
|
||||||
"{}/accounts".format(app.config["SERVER_HOST"]),
|
"{}/accounts".format(app.config["SERVER_HOST"]),
|
||||||
json={"name": name, "accountId": account_id},
|
json={"accountId": account_id},
|
||||||
headers={"X-RPC-Authentication": encoded},
|
headers={"X-RPC-Authentication": encoded},
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ class AccountView(ModelView):
|
|||||||
def after_model_change(self, form, model, is_created):
|
def after_model_change(self, form, model, is_created):
|
||||||
if is_created:
|
if is_created:
|
||||||
try:
|
try:
|
||||||
create_remote_account(model.name, model.account_id)
|
create_remote_account(model.account_id)
|
||||||
except RemoteServerException as server_error:
|
except RemoteServerException as server_error:
|
||||||
db.session.delete(model)
|
db.session.delete(model)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
Loading…
Reference in New Issue
Block a user