File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 4
4
from django .core .exceptions import ValidationError
5
5
from django .db import models
6
6
7
- from ..utils .title_resolver import is_valid_fstring , is_valid_xpath , parse_title
7
+ from ..utils .title_resolver import (
8
+ is_valid_fstring ,
9
+ is_valid_xpath ,
10
+ parse_title ,
11
+ resolve_title ,
12
+ )
8
13
from .collection_choice_fields import DocumentTypes
9
14
10
15
@@ -161,9 +166,13 @@ def apply(self) -> None:
161
166
ResolvedTitleError = apps .get_model ("sde_collections" , "ResolvedTitleError" )
162
167
163
168
for candidate_url in matched_urls :
169
+ context = {
170
+ "url" : candidate_url .url ,
171
+ "title" : candidate_url .scraped_title ,
172
+ "collection" : self .collection .name ,
173
+ }
164
174
try :
165
- # generated_title = resolve_title(self.title_pattern, context)
166
- generated_title = self .title_pattern
175
+ generated_title = resolve_title (self .title_pattern , context )
167
176
168
177
# check to see if the candidate url has an existing resolved title and delete it
169
178
ResolvedTitle .objects .filter (candidate_url = candidate_url ).delete ()
You can’t perform that action at this time.
0 commit comments