Dev (#2532)
* fix(chalice): fixed Math-operators validation refactor(chalice): search for sessions that have events for heatmaps * refactor(chalice): search for sessions that have at least 1 location event for heatmaps * fix(chalice): fixed Math-operators validation refactor(chalice): search for sessions that have events for heatmaps * refactor(chalice): search for sessions that have at least 1 location event for heatmaps * feat(chalice): autocomplete return top 10 with stats * fix(chalice): fixed autocomplete top 10 meta-filters * fix(chalice): fixed update scope for EE
This commit is contained in:
parent
1c1e6beb41
commit
92df1c671a
3 changed files with 5 additions and 7 deletions
|
|
@ -1,6 +1,5 @@
|
|||
from cachetools import cached, TTLCache
|
||||
|
||||
from chalicelib.utils import helper
|
||||
from chalicelib.utils import pg_client
|
||||
|
||||
cache = TTLCache(maxsize=1, ttl=60)
|
||||
|
|
@ -21,6 +20,6 @@ def update_scope(tenant_id, scope: int):
|
|||
SET scope_state = %(scope_state)s;""",
|
||||
{"scope_state": scope})
|
||||
cur.execute(query)
|
||||
if tenant_id in cache:
|
||||
cache.pop(tenant_id)
|
||||
if tenant_id in cache:
|
||||
cache.pop(tenant_id)
|
||||
return scope
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
from cachetools import cached, TTLCache
|
||||
|
||||
from chalicelib.utils import helper
|
||||
from chalicelib.utils import pg_client
|
||||
|
||||
cache = TTLCache(maxsize=1000, ttl=60)
|
||||
|
|
@ -24,6 +23,6 @@ def update_scope(tenant_id, scope: int):
|
|||
WHERE tenant_id=%(tenant_id)s;""",
|
||||
{"scope_state": scope, "tenant_id": tenant_id})
|
||||
cur.execute(query)
|
||||
if tenant_id in cache:
|
||||
cache.pop(tenant_id)
|
||||
if tenant_id in cache:
|
||||
cache.pop(tenant_id)
|
||||
return scope
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ def edit_account(data: schemas.EditAccountSchema = Body(...),
|
|||
@app.post('/account/scope', tags=["account"])
|
||||
def change_scope(data: schemas.ScopeSchema = Body(),
|
||||
context: schemas.CurrentContext = Depends(OR_context)):
|
||||
data = scope.update_scope(tenant_id=-1, scope=data.scope)
|
||||
data = scope.update_scope(tenant_id=context.tenant_id, scope=data.scope)
|
||||
return {'data': data}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue