Merge pull request #359 from spiralw/fix/frontpercent
Throw "no registered switches" error also with frontpercent
This commit is contained in:
commit
0dfea56d83
@ -505,6 +505,9 @@ namespace PluralKit.Bot
|
||||
var targetSystem = await GetGroupSystem(ctx, target, conn);
|
||||
ctx.CheckSystemPrivacy(targetSystem, targetSystem.FrontHistoryPrivacy);
|
||||
|
||||
var totalSwitches = await _db.Execute(conn => _repo.GetSwitchCount(conn, targetSystem.Id));
|
||||
if (totalSwitches == 0) throw Errors.NoRegisteredSwitches;
|
||||
|
||||
string durationStr = ctx.RemainderOrNull() ?? "30d";
|
||||
|
||||
var now = SystemClock.Instance.GetCurrentInstant();
|
||||
|
@ -117,6 +117,9 @@ namespace PluralKit.Bot
|
||||
if (system == null) throw Errors.NoSystemError;
|
||||
ctx.CheckSystemPrivacy(system, system.FrontHistoryPrivacy);
|
||||
|
||||
var totalSwitches = await _db.Execute(conn => _repo.GetSwitchCount(conn, system.Id));
|
||||
if (totalSwitches == 0) throw Errors.NoRegisteredSwitches;
|
||||
|
||||
string durationStr = ctx.RemainderOrNull() ?? "30d";
|
||||
|
||||
var now = SystemClock.Instance.GetCurrentInstant();
|
||||
|
Loading…
Reference in New Issue
Block a user