Spaces:
Running
Running
clementsan
commited on
Commit
•
6e8daa8
1
Parent(s):
0ea29a9
Fix alphanumeric checks for collection name
Browse files
app.py
CHANGED
@@ -200,9 +200,9 @@ def create_collection_name(filepath):
|
|
200 |
collection_name = collection_name + 'xyz'
|
201 |
## Enforce start and end as alphanumeric character
|
202 |
if not collection_name[0].isalnum():
|
203 |
-
collection_name
|
204 |
if not collection_name[-1].isalnum():
|
205 |
-
collection_name[
|
206 |
print('Filepath: ', filepath)
|
207 |
print('Collection name: ', collection_name)
|
208 |
return collection_name
|
|
|
200 |
collection_name = collection_name + 'xyz'
|
201 |
## Enforce start and end as alphanumeric character
|
202 |
if not collection_name[0].isalnum():
|
203 |
+
collection_name = 'A' + collection_name[1:]
|
204 |
if not collection_name[-1].isalnum():
|
205 |
+
collection_name = collection_name[:-1] + 'Z'
|
206 |
print('Filepath: ', filepath)
|
207 |
print('Collection name: ', collection_name)
|
208 |
return collection_name
|