Show More
@@ -158,7 +158,7 b' class ReposController(BaseController):' | |||
|
158 | 158 | form_result = {} |
|
159 | 159 | try: |
|
160 | 160 | form_result = RepoForm()(repo_groups=c.repo_groups).to_python(dict(request.POST)) |
|
161 |
repo_model.create(form_result, |
|
|
161 | repo_model.create(form_result, self.rhodecode_user) | |
|
162 | 162 | if form_result['clone_uri']: |
|
163 | 163 | h.flash(_('created repository %s from %s') \ |
|
164 | 164 | % (form_result['repo_name'], form_result['clone_uri']), |
@@ -383,7 +383,7 b' class ReposController(BaseController):' | |||
|
383 | 383 | :param repo_name: |
|
384 | 384 | """ |
|
385 | 385 | try: |
|
386 |
ScmModel().pull_changes(repo_name, |
|
|
386 | ScmModel().pull_changes(repo_name, self.rhodecode_user.username) | |
|
387 | 387 | h.flash(_('Pulled from remote location'), category='success') |
|
388 | 388 | except Exception, e: |
|
389 | 389 | h.flash(_('An error occurred during pull from remote location'), |
@@ -255,7 +255,7 b' class SettingsController(BaseController)' | |||
|
255 | 255 | """ |
|
256 | 256 | # url('admin_settings_my_account') |
|
257 | 257 | |
|
258 |
c.user = UserModel().get( |
|
|
258 | c.user = UserModel().get(self.rhodecode_user.user_id, cache=False) | |
|
259 | 259 | all_repos = [r.repo_name for r in self.sa.query(Repository)\ |
|
260 | 260 | .filter(Repository.user_id == c.user.user_id)\ |
|
261 | 261 | .order_by(func.lower(Repository.repo_name)).all()] |
@@ -283,9 +283,9 b' class SettingsController(BaseController)' | |||
|
283 | 283 | # method='put') |
|
284 | 284 | # url('admin_settings_my_account_update', id=ID) |
|
285 | 285 | user_model = UserModel() |
|
286 |
uid = |
|
|
286 | uid = self.rhodecode_user.user_id | |
|
287 | 287 | _form = UserForm(edit=True, old_data={'user_id':uid, |
|
288 |
'email': |
|
|
288 | 'email':self.rhodecode_user.email})() | |
|
289 | 289 | form_result = {} |
|
290 | 290 | try: |
|
291 | 291 | form_result = _form.to_python(dict(request.POST)) |
@@ -294,8 +294,8 b' class SettingsController(BaseController)' | |||
|
294 | 294 | category='success') |
|
295 | 295 | |
|
296 | 296 | except formencode.Invalid, errors: |
|
297 |
c.user = user_model.get( |
|
|
298 |
c.user = UserModel().get( |
|
|
297 | c.user = user_model.get(self.rhodecode_user.user_id, cache=False) | |
|
298 | c.user = UserModel().get(self.rhodecode_user.user_id, cache=False) | |
|
299 | 299 | all_repos = self.sa.query(Repository)\ |
|
300 | 300 | .filter(Repository.user_id == c.user.user_id)\ |
|
301 | 301 | .order_by(func.lower(Repository.repo_name))\ |
@@ -49,7 +49,7 b' class JournalController(BaseController):' | |||
|
49 | 49 | |
|
50 | 50 | def __before__(self): |
|
51 | 51 | super(JournalController, self).__before__() |
|
52 |
|
|
|
52 | self.rhodecode_user = self.rhodecode_user | |
|
53 | 53 | self.title = _('%s public journal %s feed') % (c.rhodecode_name, '%s') |
|
54 | 54 | self.language = 'en-us' |
|
55 | 55 | self.ttl = "5" |
@@ -52,8 +52,8 b' class LoginController(BaseController):' | |||
|
52 | 52 | #redirect if already logged in |
|
53 | 53 | c.came_from = request.GET.get('came_from', None) |
|
54 | 54 | |
|
55 |
if |
|
|
56 |
and |
|
|
55 | if self.rhodecode_user.is_authenticated \ | |
|
56 | and self.rhodecode_user.username != 'default': | |
|
57 | 57 | |
|
58 | 58 | return redirect(url('home')) |
|
59 | 59 |
@@ -189,7 +189,7 b' class SettingsController(BaseRepoControl' | |||
|
189 | 189 | try: |
|
190 | 190 | form_result = _form.to_python(dict(request.POST)) |
|
191 | 191 | form_result.update({'repo_name':repo_name}) |
|
192 |
repo_model.create_fork(form_result, |
|
|
192 | repo_model.create_fork(form_result, self.rhodecode_user) | |
|
193 | 193 | h.flash(_('forked %s repository as %s') \ |
|
194 | 194 | % (repo_name, form_result['fork_name']), |
|
195 | 195 | category='success') |
@@ -65,7 +65,7 b' class SummaryController(BaseRepoControll' | |||
|
65 | 65 | c.dbrepo = dbrepo |
|
66 | 66 | |
|
67 | 67 | c.following = self.scm_model.is_following_repo(c.repo_name, |
|
68 |
|
|
|
68 | self.rhodecode_user.user_id) | |
|
69 | 69 | def url_generator(**kw): |
|
70 | 70 | return url('shortlog_home', repo_name=c.repo_name, **kw) |
|
71 | 71 | |
@@ -79,7 +79,7 b' class SummaryController(BaseRepoControll' | |||
|
79 | 79 | username = '' |
|
80 | 80 | password = '' |
|
81 | 81 | else: |
|
82 |
username = str( |
|
|
82 | username = str(self.rhodecode_user.username) | |
|
83 | 83 | password = '@' |
|
84 | 84 | |
|
85 | 85 | uri = u'%(protocol)s://%(user)s%(password)s%(host)s%(prefix)s/%(repo_name)s' % { |
General Comments 0
You need to be logged in to leave comments.
Login now