Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
concrexit
Commits
99f77697
Unverified
Commit
99f77697
authored
Dec 06, 2016
by
Thom Wiggers
📐
Browse files
Prevent dying on album_date_something_something
parent
baa89361
Changes
1
Hide whitespace changes
Inline
Side-by-side
website/photos/management/commands/importphotos.py
View file @
99f77697
...
...
@@ -21,7 +21,7 @@ class Command(BaseCommand):
raise
Exception
(
"You must specify a directory to import"
)
foldername
=
os
.
path
.
relpath
(
options
[
'folder'
])
album
,
date
,
title
=
foldername
.
split
(
'_'
)
album
,
date
,
title
=
foldername
.
split
(
'_'
,
maxsplit
=
2
)
date
=
parse_date
(
'{}-{}-{}'
.
format
(
date
[:
4
],
date
[
4
:
6
],
date
[
6
:]))
slug
=
slugify
(
'-'
.
join
([
str
(
date
),
title
]))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment