Index: /WAeUP_SRP/trunk/ScratchCards.py
===================================================================
--- /WAeUP_SRP/trunk/ScratchCards.py	(revision 1394)
+++ /WAeUP_SRP/trunk/ScratchCards.py	(revision 1395)
@@ -136,7 +136,9 @@
               } for p in pins_cat.searchResults(prefix_batch = "%s%d"
                                                % (doc.prefix,doc.batch_no),
-                                               )[-max_pins:] if not p.student]
+                                               ) if not p.student]
+        if len(unused) > max_pins:
+            return unused[-max_pins:]
         return unused
-
+    
     security.declareProtected(View,"getUsedPins")
     def getUsedPins(self):
