From 3eb67dae63b4c344ee5925fb6e07ecf0ae7c5a95 Mon Sep 17 00:00:00 2001
From: Dominik George <nik@naturalnet.de>
Date: Thu, 2 Aug 2018 15:09:51 +0200
Subject: [PATCH] Fix comparison of selected field.

---
 django_starfield/templates/django_starfield/stars.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/django_starfield/templates/django_starfield/stars.html b/django_starfield/templates/django_starfield/stars.html
index 7df4cd3..7d5c63f 100644
--- a/django_starfield/templates/django_starfield/stars.html
+++ b/django_starfield/templates/django_starfield/stars.html
@@ -2,7 +2,7 @@
 <div class="django-starfield" id="django-starfield-{{ widget.name }}">
  {% for i in stars %}
   <input type="radio" name="{{ widget.name }}" id="{{ widget.name }}-{{ forloop.counter0 }}"
-         value="{{ i }}" {% if widget.value == i %}checked="checked"{% endif %} />
+         value="{{ i }}" {% ifequal widget.value i|stringformat:'i' %}checked="checked"{% endifequal %} />
   <label for="{{ widget.name }}-{{ forloop.counter0 }}"><span>{{ i }}</span></label>
  {% endfor %}
 </div>
-- 
GitLab