mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-29 00:38:11 -05:00
Don't automatically commit model when adding/removing multi subreddits.
This commit is contained in:
@@ -143,6 +143,8 @@ class MultiApiController(RedditController, OAuth2ResourceController):
|
||||
multi.add_srs({sr._id: {}})
|
||||
except TooManySubredditsException as e:
|
||||
raise RedditError('MULTI_TOO_MANY_SUBREDDITS', code=409)
|
||||
else:
|
||||
multi._commit()
|
||||
|
||||
@require_oauth2_scope("subscribe")
|
||||
@api_doc(api_section.multis, extends=PUT_multi_subreddit)
|
||||
@@ -155,3 +157,4 @@ class MultiApiController(RedditController, OAuth2ResourceController):
|
||||
def DELETE_multi_subreddit(self, multi, sr):
|
||||
"""Remove a subreddit from a multi."""
|
||||
multi.del_srs(sr._id)
|
||||
multi._commit()
|
||||
|
||||
@@ -1442,7 +1442,6 @@ class LabeledMulti(tdb_cassandra.Thing, MultiReddit):
|
||||
|
||||
for attr, val in sr_columns.iteritems():
|
||||
self.__setattr__(attr, val)
|
||||
self._commit()
|
||||
|
||||
def del_srs(self, sr_ids):
|
||||
"""Delete subreddit(s)."""
|
||||
@@ -1450,7 +1449,6 @@ class LabeledMulti(tdb_cassandra.Thing, MultiReddit):
|
||||
keys = self.sr_props_to_columns(dict.fromkeys(sr_ids, '')).keys()
|
||||
for key in keys:
|
||||
self.__delitem__(key)
|
||||
self._commit()
|
||||
|
||||
def delete(self):
|
||||
# Do we want to actually delete objects?
|
||||
|
||||
Reference in New Issue
Block a user