Commit 88598897 authored by Romain Courteaud's avatar Romain Courteaud

romain_dev: up

parent 422ba5a1
...@@ -4,9 +4,11 @@ post_per_thread_amount = 97 ...@@ -4,9 +4,11 @@ post_per_thread_amount = 97
max_new_document = 100 max_new_document = 100
tag = 'POPULATE_FORUM' tag = 'POPULATE_FORUM'
after_tag = tag + 'XXX'
if (current_project_uid is None) and (created_project_count < project_count): if (current_project_uid is None):
if (created_project_count < project_count):
created_project_count += 1 created_project_count += 1
created_thread_count = 0 created_thread_count = 0
created_post_count = 0 created_post_count = 0
...@@ -16,26 +18,33 @@ if (current_project_uid is None) and (created_project_count < project_count): ...@@ -16,26 +18,33 @@ if (current_project_uid is None) and (created_project_count < project_count):
title='Forum project %i' % created_project_count, title='Forum project %i' % created_project_count,
activate_kw={'tag': tag} activate_kw={'tag': tag}
) )
return context.activate(after_tag=tag).testromain( return context.activate(after_tag=after_tag).testromain(
current_project_uid=project.getUid(), current_project_uid=project.getUid(),
created_project_count=created_project_count created_project_count=created_project_count
) )
else:
return 'stopping'
if (current_thread_path is None) and (created_thread_count < thread_per_project_count): if (current_thread_path is None):
if (created_thread_count < thread_per_project_count):
created_thread_count += 1 created_thread_count += 1
thread = context.discussion_thread_module.newContent( thread = context.discussion_thread_module.newContent(
portal_type='Discussion Thread', portal_type='Discussion Thread',
title='Forum project %i discussion %i' % (created_project_count, created_thread_count), title='New Forum project %i discussion %i' % (created_project_count, created_thread_count),
follow_up_uid=current_project_uid, follow_up_uid=current_project_uid,
activate_kw={'tag': tag} activate_kw={'tag': tag}
) )
thread.share() thread.share()
return context.activate(after_tag=tag).testromain( return context.activate(after_tag=after_tag).testromain(
current_project_uid=current_project_uid, current_project_uid=current_project_uid,
current_thread_path=thread.getRelativeUrl(), current_thread_path=thread.getRelativeUrl(),
created_project_count=created_project_count, created_project_count=created_project_count,
created_thread_count=created_thread_count created_thread_count=created_thread_count
) )
else:
return context.activate(after_tag=after_tag).testromain(
created_project_count=created_project_count
)
if (current_thread_path is not None): if (current_thread_path is not None):
if (created_post_count < post_per_thread_amount): if (created_post_count < post_per_thread_amount):
...@@ -48,7 +57,7 @@ if (current_thread_path is not None): ...@@ -48,7 +57,7 @@ if (current_thread_path is not None):
activate_kw={'tag': tag} activate_kw={'tag': tag}
) )
# post.share() # post.share()
return context.activate(after_tag=tag).testromain( return context.activate(after_tag=after_tag).testromain(
current_project_uid=current_project_uid, current_project_uid=current_project_uid,
current_thread_path=current_thread_path, current_thread_path=current_thread_path,
created_project_count=created_project_count, created_project_count=created_project_count,
...@@ -56,7 +65,7 @@ if (current_thread_path is not None): ...@@ -56,7 +65,7 @@ if (current_thread_path is not None):
created_post_count=created_post_count created_post_count=created_post_count
) )
else: else:
return context.activate(after_tag=tag).testromain( return context.activate(after_tag=after_tag).testromain(
current_project_uid=current_project_uid, current_project_uid=current_project_uid,
created_project_count=created_project_count, created_project_count=created_project_count,
created_thread_count=created_thread_count created_thread_count=created_thread_count
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment