Skip to content

Commit ecefc99

Browse files
committed
Fixed bug in get_migration_modules - couldn't handle non Python files
1 parent 8261ed0 commit ecefc99

File tree

1 file changed

+2
-2
lines changed
  • piccolo/apps/migrations/commands

1 file changed

+2
-2
lines changed

piccolo/apps/migrations/commands/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ def get_migration_modules(
102102
sys.path.insert(0, folder_path)
103103

104104
folder_contents = os.listdir(folder_path)
105-
excluded = ("__init__.py", "__pycache__")
105+
excluded = ("__init__.py",)
106106
migration_names = [
107107
i.split(".py")[0]
108108
for i in folder_contents
109-
if ((i not in excluded) and (not i.startswith(".")))
109+
if ((i not in excluded) and i.endswith(".py"))
110110
]
111111

112112
modules: t.List[MigrationModule] = [

0 commit comments

Comments
 (0)