Mercurial > kallithea
comparison rhodecode/controllers/journal.py @ 1749:8ecc6b8229a5 beta
commit less models
- models don't do any commits(with few exceptions)
- all db transactions should be handled by higher level modules like controllers, celery tasks
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 02 Dec 2011 22:31:13 +0200 |
parents | fcbc35ecb024 |
children | 89efedac4e6c |
comparison
equal
deleted
inserted
replaced
1748:a3ee2611e6e8 | 1749:8ecc6b8229a5 |
---|---|
132 user_id = request.POST.get('follows_user_id') | 132 user_id = request.POST.get('follows_user_id') |
133 if user_id: | 133 if user_id: |
134 try: | 134 try: |
135 self.scm_model.toggle_following_user(user_id, | 135 self.scm_model.toggle_following_user(user_id, |
136 self.rhodecode_user.user_id) | 136 self.rhodecode_user.user_id) |
137 Session().commit() | 137 Session.commit() |
138 return 'ok' | 138 return 'ok' |
139 except: | 139 except: |
140 raise HTTPBadRequest() | 140 raise HTTPBadRequest() |
141 | 141 |
142 repo_id = request.POST.get('follows_repo_id') | 142 repo_id = request.POST.get('follows_repo_id') |
143 if repo_id: | 143 if repo_id: |
144 try: | 144 try: |
145 self.scm_model.toggle_following_repo(repo_id, | 145 self.scm_model.toggle_following_repo(repo_id, |
146 self.rhodecode_user.user_id) | 146 self.rhodecode_user.user_id) |
147 Session().commit() | 147 Session.commit() |
148 return 'ok' | 148 return 'ok' |
149 except: | 149 except: |
150 raise HTTPBadRequest() | 150 raise HTTPBadRequest() |
151 | 151 |
152 log.debug('token mismatch %s vs %s', cur_token, token) | 152 log.debug('token mismatch %s vs %s', cur_token, token) |