Show More
@@ -270,7 +270,7 b' class GistView(BaseAppView):' | |||||
270 | @view_config( |
|
270 | @view_config( | |
271 | route_name='gist_show_formatted_path', request_method='GET', |
|
271 | route_name='gist_show_formatted_path', request_method='GET', | |
272 | renderer=None) |
|
272 | renderer=None) | |
273 | def show(self): |
|
273 | def gist_show(self): | |
274 | gist_id = self.request.matchdict['gist_id'] |
|
274 | gist_id = self.request.matchdict['gist_id'] | |
275 |
|
275 | |||
276 | # TODO(marcink): expose those via matching dict |
|
276 | # TODO(marcink): expose those via matching dict |
@@ -43,7 +43,7 b' def includeme(config):' | |||||
43 |
|
43 | |||
44 | config.add_route( |
|
44 | config.add_route( | |
45 | name='my_account_password_update', |
|
45 | name='my_account_password_update', | |
46 | pattern=ADMIN_PREFIX + '/my_account/password') |
|
46 | pattern=ADMIN_PREFIX + '/my_account/password/update') | |
47 |
|
47 | |||
48 | # my account tokens |
|
48 | # my account tokens | |
49 | config.add_route( |
|
49 | config.add_route( |
@@ -37,6 +37,8 b' def route_path(name, **kwargs):' | |||||
37 | 'home': '/', |
|
37 | 'home': '/', | |
38 | 'my_account_password': |
|
38 | 'my_account_password': | |
39 | ADMIN_PREFIX + '/my_account/password', |
|
39 | ADMIN_PREFIX + '/my_account/password', | |
|
40 | 'my_account_password_update': | |||
|
41 | ADMIN_PREFIX + '/my_account/password/update', | |||
40 | }[name].format(**kwargs) |
|
42 | }[name].format(**kwargs) | |
41 |
|
43 | |||
42 |
|
44 | |||
@@ -58,7 +60,8 b' class TestMyAccountPassword(TestControll' | |||||
58 | ('__end__', 'new_password:mapping'), |
|
60 | ('__end__', 'new_password:mapping'), | |
59 | ('csrf_token', self.csrf_token), |
|
61 | ('csrf_token', self.csrf_token), | |
60 | ] |
|
62 | ] | |
61 | response = self.app.post(route_path('my_account_password'), form_data).follow() |
|
63 | response = self.app.post( | |
|
64 | route_path('my_account_password_update'), form_data).follow() | |||
62 | assert 'Successfully updated password' in response |
|
65 | assert 'Successfully updated password' in response | |
63 |
|
66 | |||
64 | # check_password depends on user being in session |
|
67 | # check_password depends on user being in session | |
@@ -91,7 +94,8 b' class TestMyAccountPassword(TestControll' | |||||
91 | ('__end__', 'new_password:mapping'), |
|
94 | ('__end__', 'new_password:mapping'), | |
92 | ('csrf_token', self.csrf_token), |
|
95 | ('csrf_token', self.csrf_token), | |
93 | ] |
|
96 | ] | |
94 | response = self.app.post(route_path('my_account_password'), form_data) |
|
97 | response = self.app.post( | |
|
98 | route_path('my_account_password_update'), form_data) | |||
95 |
|
99 | |||
96 | assert_response = response.assert_response() |
|
100 | assert_response = response.assert_response() | |
97 | assert assert_response.get_elements('.error-block') |
|
101 | assert assert_response.get_elements('.error-block') | |
@@ -109,7 +113,8 b' class TestMyAccountPassword(TestControll' | |||||
109 | ('__end__', 'new_password:mapping'), |
|
113 | ('__end__', 'new_password:mapping'), | |
110 | ('csrf_token', self.csrf_token), |
|
114 | ('csrf_token', self.csrf_token), | |
111 | ] |
|
115 | ] | |
112 | response = self.app.post(route_path('my_account_password'), form_data) |
|
116 | response = self.app.post( | |
|
117 | route_path('my_account_password_update'), form_data) | |||
113 | assert_session_flash( |
|
118 | assert_session_flash( | |
114 | response, 'Error occurred during update of user password') |
|
119 | response, 'Error occurred during update of user password') | |
115 |
|
120 | |||
@@ -129,7 +134,8 b' class TestMyAccountPassword(TestControll' | |||||
129 | ('__end__', 'new_password:mapping'), |
|
134 | ('__end__', 'new_password:mapping'), | |
130 | ('csrf_token', self.csrf_token), |
|
135 | ('csrf_token', self.csrf_token), | |
131 | ] |
|
136 | ] | |
132 | self.app.post(route_path('my_account_password'), form_data) |
|
137 | self.app.post( | |
|
138 | route_path('my_account_password_update'), form_data) | |||
133 |
|
139 | |||
134 | response = self.app.get(route_path('home')) |
|
140 | response = self.app.get(route_path('home')) | |
135 | session = response.get_session_from_response() |
|
141 | session = response.get_session_from_response() |
@@ -90,7 +90,9 b' class MyAccountView(BaseAppView, DataGri' | |||||
90 | username=c.user.username) |
|
90 | username=c.user.username) | |
91 |
|
91 | |||
92 | form = forms.Form( |
|
92 | form = forms.Form( | |
93 | schema, buttons=(forms.buttons.save, forms.buttons.reset)) |
|
93 | schema, | |
|
94 | action=h.route_path('my_account_password_update'), | |||
|
95 | buttons=(forms.buttons.save, forms.buttons.reset)) | |||
94 |
|
96 | |||
95 | c.form = form |
|
97 | c.form = form | |
96 | return self._get_template_context(c) |
|
98 | return self._get_template_context(c) | |
@@ -99,7 +101,7 b' class MyAccountView(BaseAppView, DataGri' | |||||
99 | @NotAnonymous() |
|
101 | @NotAnonymous() | |
100 | @CSRFRequired() |
|
102 | @CSRFRequired() | |
101 | @view_config( |
|
103 | @view_config( | |
102 | route_name='my_account_password', request_method='POST', |
|
104 | route_name='my_account_password_update', request_method='POST', | |
103 | renderer='rhodecode:templates/admin/my_account/my_account.mako') |
|
105 | renderer='rhodecode:templates/admin/my_account/my_account.mako') | |
104 | def my_account_password_update(self): |
|
106 | def my_account_password_update(self): | |
105 | _ = self.request.translate |
|
107 | _ = self.request.translate |
@@ -162,6 +162,9 b' class RepoSummaryView(RepoAppView):' | |||||
162 | @view_config( |
|
162 | @view_config( | |
163 | route_name='repo_summary_slash', request_method='GET', |
|
163 | route_name='repo_summary_slash', request_method='GET', | |
164 | renderer='rhodecode:templates/summary/summary.mako') |
|
164 | renderer='rhodecode:templates/summary/summary.mako') | |
|
165 | @view_config( | |||
|
166 | route_name='repo_summary_explicit', request_method='GET', | |||
|
167 | renderer='rhodecode:templates/summary/summary.mako') | |||
165 | def summary(self): |
|
168 | def summary(self): | |
166 | c = self.load_default_context() |
|
169 | c = self.load_default_context() | |
167 |
|
170 |
@@ -39,7 +39,7 b' class UserProfileView(BaseAppView):' | |||||
39 | @view_config( |
|
39 | @view_config( | |
40 | route_name='user_profile', request_method='GET', |
|
40 | route_name='user_profile', request_method='GET', | |
41 | renderer='rhodecode:templates/users/user.mako') |
|
41 | renderer='rhodecode:templates/users/user.mako') | |
42 |
def |
|
42 | def user_profile(self): | |
43 | # register local template context |
|
43 | # register local template context | |
44 | c = self._get_local_tmpl_context() |
|
44 | c = self._get_local_tmpl_context() | |
45 | c.active = 'user_profile' |
|
45 | c.active = 'user_profile' |
General Comments 0
You need to be logged in to leave comments.
Login now