def start(self, context, request, appstruct, **kw):
user = get_current()
artists, new_artists = extract_artists(
appstruct.get('artists', []), request)
context.setproperty('artists', artists)
context.modified_at = datetime.datetime.now(tz=pytz.UTC)
context.set_metadata(appstruct)
if 'published' in context.state:
not_published_artists = [a for a in context.artists
if 'published' not in a.state]
for artist in not_published_artists:
publish_artist(artist, request, user)
context.reindex()
new_objects = new_artists
new_objects.append(context)
request.registry.notify(ActivityExecuted(self, new_objects, user))
return {}
评论列表
文章目录