Skip to content

Commit

Permalink
fixed access controlled device event logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jabelone committed Oct 22, 2023
1 parent aca884a commit 303389f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions memberportal/access/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,24 +90,22 @@ def __str__(self):
def log_access(self, member_id, success=True):
pass

def log_event(self, description=None, event_type=None, data=None):
def log_event(self, description=None, data=None):
if self.type == "door":
log_event(
description=description, event_type=event_type, data=data, door=self
)
log_event(description=description, event_type="door", data=data, door=self)
return True
elif self.type == "interlock":
log_event(
description=description,
event_type=event_type,
event_type="interlock",
data=data,
interlock=self,
)
return True
elif self.type == "memberbucks":
log_event(
description=description,
event_type=event_type,
event_type="memberbucksdevice",
data=data,
memberbucks_device=self,
)
Expand Down
2 changes: 1 addition & 1 deletion memberportal/profile/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def log_event(
):
EventLog(
description=description,
logtype=event_type,
logtype="generic" if event_type is None else event_type,
data=data,
door=door,
interlock=interlock,
Expand Down

0 comments on commit 303389f

Please sign in to comment.