Commit 29709b46 authored by Penny Leach's avatar Penny Leach
Browse files

randomdata now also adds community memeber request and invites.

skips adding the community owner too
parent e5a37436
......@@ -235,11 +235,22 @@ sub insert_random_communities {
$members->{$existing_users->{((keys %$existing_users)[int(rand(keys %$existing_users))])}{id}} = 1;
}
foreach my $id (keys %$members) {
next if $id == $user_id;
$self->{dbh}->do(
'INSERT INTO ' . $prefix . 'community_member (community,member,ctime) VALUES (currval(\'' . $prefix . 'community_id_seq\'),?,current_timestamp)',
undef,
$id,
);
$self->{dbh}->do(
'INSERT INTO ' . $prefix . 'community_member_invite (community,member,ctime) VALUES (currval(\'' . $prefix . 'community_id_seq\'),?,current_timestamp)',
undef,
$id,
);
$self->{dbh}->do(
'INSERT INTO ' . $prefix . 'community_member_request (community,member,ctime) VALUES (currval(\'' . $prefix . 'community_id_seq\'),?,current_timestamp)',
undef,
$id,
);
}
}
......
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