forked from Dniel97/artemis
aimedb: fix lookup with banned or locked access code
This commit is contained in:
parent
4550cb2af5
commit
0c3924a8f0
@ -1,6 +1,13 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
Documenting updates to ARTEMiS, to be updated every time the master branch is pushed to.
|
Documenting updates to ARTEMiS, to be updated every time the master branch is pushed to.
|
||||||
|
|
||||||
|
## 20240109
|
||||||
|
### System
|
||||||
|
+ Removed `ADD config config` from dockerfile
|
||||||
|
|
||||||
|
### Aimedb
|
||||||
|
+ Fixed an error that resulted from trying to scan a banned or locked card
|
||||||
|
|
||||||
## 20240108
|
## 20240108
|
||||||
### System
|
### System
|
||||||
+ Change how the underlying system handles URLs
|
+ Change how the underlying system handles URLs
|
||||||
|
@ -149,13 +149,13 @@ class AimedbProtocol(Protocol):
|
|||||||
is_banned = self.data.card.get_card_banned(req.access_code)
|
is_banned = self.data.card.get_card_banned(req.access_code)
|
||||||
is_locked = self.data.card.get_card_locked(req.access_code)
|
is_locked = self.data.card.get_card_locked(req.access_code)
|
||||||
|
|
||||||
|
ret = ADBLookupResponse.from_req(req.head, user_id)
|
||||||
if is_banned and is_locked:
|
if is_banned and is_locked:
|
||||||
ret.head.status = ADBStatus.BAN_SYS_USER
|
ret.head.status = ADBStatus.BAN_SYS_USER
|
||||||
elif is_banned:
|
elif is_banned:
|
||||||
ret.head.status = ADBStatus.BAN_SYS
|
ret.head.status = ADBStatus.BAN_SYS
|
||||||
elif is_locked:
|
elif is_locked:
|
||||||
ret.head.status = ADBStatus.LOCK_USER
|
ret.head.status = ADBStatus.LOCK_USER
|
||||||
ret = ADBLookupResponse.from_req(req.head, user_id)
|
|
||||||
|
|
||||||
self.logger.info(
|
self.logger.info(
|
||||||
f"access_code {req.access_code} -> user_id {ret.user_id}"
|
f"access_code {req.access_code} -> user_id {ret.user_id}"
|
||||||
|
Loading…
Reference in New Issue
Block a user