Skip to content
Snippets Groups Projects
Commit 586f5890 authored by Bastien Abadie's avatar Bastien Abadie
Browse files

Merge branch 'facepalm-data-migration' into 'master'

Fix slash stripping in Image data migration

See merge request !247
parents fd9ec32b 4e423a9e
No related branches found
No related tags found
1 merge request!247Fix slash stripping in Image data migration
......@@ -16,7 +16,7 @@ def deduplicate_and_strip(apps, schema_editor):
ImageServer.objects.annotate(
# PostgreSQL supports trimming things that are not just spaces,
# But django.db.models.functions.Trim doesn't.
trimmed_url=RawSQL("trim(trailing '/' from url)", ())
trimmed_url=RawSQL("trim(leading '/' from url)", ())
).order_by('trimmed_url'),
key=lambda s: s.trimmed_url,
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment