summaryrefslogtreecommitdiff
path: root/lib/Kratos/DFADriver
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2017-06-01 09:38:35 +0200
committerDaniel Friesel <derf@finalrewind.org>2017-06-01 09:38:35 +0200
commitf9db277a72fece83bd9fed77c793a73b7e3d8360 (patch)
treeea96c5bb93355be74f0931efb3b1fdc815ce753c /lib/Kratos/DFADriver
parent286a50b1e1ee21a8dbb2c66d9cb9a69ba541e480 (diff)
UNINITIALIZED always has ID 0
Diffstat (limited to 'lib/Kratos/DFADriver')
-rw-r--r--lib/Kratos/DFADriver/Model.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Kratos/DFADriver/Model.pm b/lib/Kratos/DFADriver/Model.pm
index aff44cf..216f3b8 100644
--- a/lib/Kratos/DFADriver/Model.pm
+++ b/lib/Kratos/DFADriver/Model.pm
@@ -144,6 +144,10 @@ sub new_from_repo {
@states = uniq @states;
@states = sort @states;
+ # by convention, UNINITIALIZED always has ID 0
+ @states = grep { $_ ne 'UNINITIALIZED' } @states;
+ unshift( @states, 'UNINITIALIZED' );
+
for my $i ( 0 .. $#states ) {
$self->{state}{ $states[$i] } = {
id => $i,