Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Removing meetups

moggyboy edited this page Nov 7, 2014 · 5 revisions

Meetups are represented by both a post to the meetup's Subreddit and by a Meetup object. Both must be deleted for the meetup to be completely removed from the site.

To setup for testing in dev:

  1. Run paster shell environment.ini where environment can be development, test, etc.

  2. Import all models: from r2.models import Account, Subreddit

  3. Get the meetups subreddit: sr = Subreddit._by_name('meetups')

  4. Get the user account: account = Account._by_name('user_name')

  5. Grant yourself enough karma to create meetups: account.incr_karma('link', sr, 50, 0)

  6. Go to your dev/test site and click "Add Meetup"

  7. Fill in the details and save.

To remove a meetup:

  1. Run paster shell environment.ini where environment can be development, test, etc.

  2. Import all models: from r2.models import Account, Link, Meetup

  3. Get the ID of the meetup from its URL, you access this by clicking the link to the meetup under "Meetups" on the right hand side of the screen - e.g. http://host/meetups/1 means the meetup ID is 1

  4. Retrieve the meetup object: meetup = Meetup._byID(int("1", 36))

  5. Double-check you have the right meetup object: meetup.title

  6. Delete the meetup object: meetup._delete_from_db()

  7. Go to the meetups subreddit at http://host/r/meetups and click the meetup post you want to delete

  8. Get the ID of the meetup post from its URL - e.g. http://host/r/meetups/sitecode/2/meetup_name means the meetup id is 2.

  9. Get the meetup post: link = Link._byID(int("2", 36), data=True)

  10. Double-check you have the right meetup post: link.title

  11. Delete the meetup post: link._delete_from_db()

  12. If you absolutely want the link gone from the right hand side of the screen, you'll need to refresh the cache, but this will happen at semi-regular intervals naturally.

Clone this wiki locally