Skip to content

Commit

Permalink
Fix submission limit bug (#1745)
Browse files Browse the repository at this point in the history
* only set submission allowed timestamp if we have something to timestamp

* fix whitespace
  • Loading branch information
Masterjun3 authored Jan 17, 2024
1 parent 7c932bb commit 4c79066
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion TASVideos/Pages/Submissions/Submit.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,11 @@ public async Task<bool> SubmissionAllowed(int userId)
&& s.SubmitterId == userId
&& s.CreateTimestamp > DateTime.UtcNow.AddDays(-_settings.SubmissionRate.Days))
.ToListAsync();
_earliestTimestamp = subs.Select(s => s.CreateTimestamp).Min();
if (subs.Count > 0)
{
_earliestTimestamp = subs.Select(s => s.CreateTimestamp).Min();
}

return subs.Count < _settings.SubmissionRate.Submissions;
}
}

0 comments on commit 4c79066

Please sign in to comment.