Creating discourse user group with code

I need to create a discourse user group with my plugin. I used the below code and its not working. Any idea why its not working ? Thankyou

default_group = Group.new(
        name: 'Dumy',
        visibility_level: Group.visibility_levels[:public],
        primary_group: true,
        title: 'Dumy',
        flair_url: 'https://dumy.com/public/images/oc-logo-icon.svg',
        bio_raw: 'Dumy wording.',
        full_name: 'dummy'
      )
default_group.save!

I referred to the code used in patreon plugin

Thank you @riking for fixing the link

Are you seeing any errors in /logs? Can you link to the relevant plugin code if it’s publicly available on GitHub?

1 Like

Hi @techAPJ,
I’m not seeing any errors on my logs. This is the repo of my plugin

https://github.com/sudaraka94/opencollective-plugin

I was adding the feature in the branch user-profile-details

https://github.com/sudaraka94/opencollective-plugin/blob/813e83ae3f859a95acf2404ebe83ace385681fe8/plugin.rb#L57