示例#1
0
    def create_org(self, username=org_user_name, password=org_user_password, org_name='org', prefix='org_p', quota=100, member_limit=100):
        new_org = ccnet_threaded_rpc.get_org_by_url_prefix(prefix)
        if new_org:
            return new_org

        quota = int(quota)
        User.objects.create_user(username, password, is_staff=False, is_active=True)
        create_org(org_name, prefix, username)
        new_org = ccnet_threaded_rpc.get_org_by_url_prefix(prefix)
        from seahub_extra.organizations.models import OrgMemberQuota
        OrgMemberQuota.objects.set_quota(new_org.org_id, member_limit)
        quota = quota * get_file_size_unit('MB')
        seafserv_threaded_rpc.set_org_quota(new_org.org_id, quota)

        return new_org
示例#2
0
    def create_org(self, username=org_user_name, password=org_user_password, org_name='org', prefix='org_p', quota=100, member_limit=100):
        new_org = ccnet_threaded_rpc.get_org_by_url_prefix(prefix)
        if new_org:
            return new_org

        quota = int(quota)
        User.objects.create_user(username, password, is_staff=False, is_active=True)
        create_org(org_name, prefix, username)
        new_org = ccnet_threaded_rpc.get_org_by_url_prefix(prefix)
        from seahub_extra.organizations.models import OrgMemberQuota
        OrgMemberQuota.objects.set_quota(new_org.org_id, member_limit)
        quota = quota * get_file_size_unit('MB')
        seafserv_threaded_rpc.set_org_quota(new_org.org_id, quota)

        return new_org
示例#3
0
def create_org(org_name, url_prefix, creator):
    return seaserv.create_org(org_name, url_prefix, creator)