##// END OF EJS Templates
login: removed log_session model, and replaced it with two lines of code....
marcink -
r1321:cb7ffeab default
parent child Browse files
Show More
@@ -39,7 +39,6 b' from rhodecode.lib.exceptions import Use'
39 39 from rhodecode.lib.utils2 import safe_str
40 40 from rhodecode.model.db import User
41 41 from rhodecode.model.forms import LoginForm, RegisterForm, PasswordResetForm
42 from rhodecode.model.login_session import LoginSession
43 42 from rhodecode.model.meta import Session
44 43 from rhodecode.model.settings import SettingsModel
45 44 from rhodecode.model.user import UserModel
@@ -158,11 +157,11 b' class LoginView(object):'
158 157 renderer='rhodecode:templates/login.mako')
159 158 def login_post(self):
160 159 came_from = get_came_from(self.request)
161 session = self.request.session
160
162 161 login_form = LoginForm()()
163 162
164 163 try:
165 session.invalidate()
164 self.session.invalidate()
166 165 form_result = login_form.to_python(self.request.params)
167 166 # form checks for username/password, now we're authenticated
168 167 headers = _store_user_in_session(
@@ -187,13 +186,15 b' class LoginView(object):'
187 186 # the fly can throw this exception signaling that there's issue
188 187 # with user creation, explanation should be provided in
189 188 # Exception itself
190 session.flash(e, queue='error')
189 self.session.flash(e, queue='error')
191 190 return self._get_template_context()
192 191
193 192 @CSRFRequired()
194 193 @view_config(route_name='logout', request_method='POST')
195 194 def logout(self):
196 LoginSession().destroy_user_session()
195 user = self.request.user
196 log.info('Deleting session for user: `%s`', user)
197 self.session.delete()
197 198 return HTTPFound(url('home'))
198 199
199 200 @HasPermissionAnyDecorator(
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now