-
Notifications
You must be signed in to change notification settings - Fork 23
Removing meetups
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:
-
Run
paster shell environment.ini
where environment can be development, test, etc. -
Import all models:
from r2.models import Account, Subreddit
-
Get the meetups subreddit:
sr = Subreddit._by_name('meetups')
-
Get the user account:
account = Account._by_name('user_name')
-
Grant yourself enough karma to create meetups:
account.incr_karma('link', sr, 50, 0)
-
Go to your dev/test site and click "Add Meetup"
-
Fill in the details and save.
To remove a meetup:
-
Run
paster shell environment.ini
where environment can be development, test, etc. -
Import all models:
from r2.models import Account, Link, Meetup
-
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
-
Retrieve the meetup object:
meetup = Meetup._byID(int("1", 36))
-
Double-check you have the right meetup object:
meetup.title
-
Delete the meetup object:
meetup._delete_from_db()
-
Go to the meetups subreddit at http://host/r/meetups and click the meetup post you want to delete
-
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.
-
Get the meetup post:
link = Link._byID(int("2", 36), data=True)
-
Double-check you have the right meetup post:
link.title
-
Delete the meetup post:
link._delete_from_db()
-
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.