pycroft icon indicating copy to clipboard operation
pycroft copied to clipboard

UserTask log entries shown on the wrong user

Open ibot3 opened this issue 10 months ago • 3 comments

Currently, the task logs are shown in the log table of the author of the tasks. However, this is not intended, as the task logs should be shown in the log table of the target user.

I am not sure, but maybe the relationship is inconsistent. The relationship on TaskLogEntry side seems to be correct: https://github.com/agdsn/pycroft/blob/f25dc1fb9c750af9d93168d99b1fcf314ebde450/pycroft/model/logging.py#L57-L62

But on the user site, the join condition is missing: https://github.com/agdsn/pycroft/blob/f25dc1fb9c750af9d93168d99b1fcf314ebde450/pycroft/model/user.py#L249-L251

SQLA maybe does a relationship with the author instead because of that? (Commit https://github.com/agdsn/pycroft/commit/a7efe204f1ae5495a02550c79318e1e86ec87280#diff-8d7fe1e2c7af484e9b87c16b9981b631d191918ca6886c1c17cb3c2b08546afd)

Another bug I noticed: Opening the tab for just the task logs shows error 404

ibot3 avatar Mar 30 '24 23:03 ibot3