Show More
@@ -43,7 +43,7 from rhodecode.lib.celerylib import task | |||
|
43 | 43 | from rhodecode.lib.utils import repo2db_mapper, invalidate_cache, \ |
|
44 | 44 | set_rhodecode_config, repo_name_slug |
|
45 | 45 | from rhodecode.model.db import RhodeCodeUi, Repository, RepoGroup, \ |
|
46 | RhodeCodeSetting | |
|
46 | RhodeCodeSetting, PullRequest, PullRequestReviewers | |
|
47 | 47 | from rhodecode.model.forms import UserForm, ApplicationSettingsForm, \ |
|
48 | 48 | ApplicationUiSettingsForm |
|
49 | 49 | from rhodecode.model.scm import ScmModel |
@@ -51,6 +51,8 from rhodecode.model.user import UserMod | |||
|
51 | 51 | from rhodecode.model.db import User |
|
52 | 52 | from rhodecode.model.notification import EmailNotificationModel |
|
53 | 53 | from rhodecode.model.meta import Session |
|
54 | from pylons.decorators import jsonify | |
|
55 | from rhodecode.model.pull_request import PullRequestModel | |
|
54 | 56 | |
|
55 | 57 | log = logging.getLogger(__name__) |
|
56 | 58 | |
@@ -369,11 +371,6 class SettingsController(BaseController) | |||
|
369 | 371 | Session.commit() |
|
370 | 372 | except formencode.Invalid, errors: |
|
371 | 373 | c.user = User.get(self.rhodecode_user.user_id) |
|
372 | all_repos = self.sa.query(Repository)\ | |
|
373 | .filter(Repository.user_id == c.user.user_id)\ | |
|
374 | .order_by(func.lower(Repository.repo_name))\ | |
|
375 | .all() | |
|
376 | c.user_repos = ScmModel().get_repos(all_repos) | |
|
377 | 374 | |
|
378 | 375 | c.form = htmlfill.render( |
|
379 | 376 | render('admin/users/user_edit_my_account_form.html'), |
@@ -389,6 +386,26 class SettingsController(BaseController) | |||
|
389 | 386 | |
|
390 | 387 | return redirect(url('my_account')) |
|
391 | 388 | |
|
389 | def my_account_my_repos(self): | |
|
390 | all_repos = self.sa.query(Repository)\ | |
|
391 | .filter(Repository.user_id == self.rhodecode_user.user_id)\ | |
|
392 | .order_by(func.lower(Repository.repo_name))\ | |
|
393 | .all() | |
|
394 | c.user_repos = ScmModel().get_repos(all_repos) | |
|
395 | return render('admin/users/user_edit_my_account_repos.html') | |
|
396 | ||
|
397 | def my_account_my_pullrequests(self): | |
|
398 | c.my_pull_requests = PullRequest.query()\ | |
|
399 | .filter(PullRequest.user_id== | |
|
400 | self.rhodecode_user.user_id)\ | |
|
401 | .all() | |
|
402 | c.participate_in_pull_requests = \ | |
|
403 | [x.pull_request for x in PullRequestReviewers.query()\ | |
|
404 | .filter(PullRequestReviewers.user_id== | |
|
405 | self.rhodecode_user.user_id)\ | |
|
406 | .all()] | |
|
407 | return render('admin/users/user_edit_my_account_pullrequests.html') | |
|
408 | ||
|
392 | 409 | @NotAnonymous() |
|
393 | 410 | @HasPermissionAnyDecorator('hg.admin', 'hg.create.repository') |
|
394 | 411 | def create_repository(self): |
General Comments 0
You need to be logged in to leave comments.
Login now