Creating discourse user group with code


(Sudaraka Jayathilaka) #1

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


(Sudaraka Jayathilaka) #2

Thank you @riking for fixing the link


(Arpit Jalan) #3

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


(Sudaraka Jayathilaka) #4

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

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