Skip to content

Commit

Permalink
Fix #2476
Browse files Browse the repository at this point in the history
  • Loading branch information
joernu76 committed Aug 28, 2024
1 parent 4344e00 commit fa42142
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions mslib/mscolab/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,10 @@ def set_last_used():
op_id = request.form.get('op_id', None)
user = g.user
days_ago = int(request.form.get('days', 0))
if days_ago > 99999:
days_ago = 99999
elif days_ago < -99999:
days_ago = -99999
fm.update_operation(int(op_id), 'last_used',
datetime.datetime.now(tz=datetime.timezone.utc) - datetime.timedelta(days=days_ago),
user)
Expand Down
2 changes: 1 addition & 1 deletion mslib/msui/mscolab.py
Original file line number Diff line number Diff line change
Expand Up @@ -1788,7 +1788,7 @@ def archive_operation(self):
"token": self.token,
"op_id": self.active_op_id,
# when a user archives an operation we set the max “natural” integer in days
"days": sys.maxsize,
"days": 99999, # larger values run into a lot of issues
}
url = urljoin(self.mscolab_server_url, 'set_last_used')
try:
Expand Down

0 comments on commit fa42142

Please sign in to comment.