diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/parser/SampleUploadSectionsParser.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/parser/SampleUploadSectionsParser.java
index db117e5b46c16e6fa955405ab51f5ede537ba39f..d941766e4386dfc19f687ce491225da6a7bb49a9 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/parser/SampleUploadSectionsParser.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/server/parser/SampleUploadSectionsParser.java
@@ -102,8 +102,11 @@ public class SampleUploadSectionsParser
             switch (operationKind)
             {
                 case REGISTRATION:
-                    generateIdentifiers(defaultGroupIdentifier, sampleCodeGeneratorOrNull,
-                            isAutoGenerateCodes, newSamples);
+                    if (isAutoGenerateCodes)
+                    {
+                        generateIdentifiers(defaultGroupIdentifier, sampleCodeGeneratorOrNull,
+                                isAutoGenerateCodes, newSamples);
+                    }
                     break;
                 case UPDATE:
                     fillIdentifiers(defaultGroupIdentifier, newSamples);