Show More
@@ -107,17 +107,19 def set_base_path(config): | |||
|
107 | 107 | |
|
108 | 108 | def fill_data(user): |
|
109 | 109 | """ |
|
110 | Fills user data with those from database | |
|
110 | Fills user data with those from database and log out user if not present | |
|
111 | in database | |
|
111 | 112 | @param user: |
|
112 | 113 | """ |
|
113 | 114 | sa = meta.Session |
|
114 | 115 | dbuser = sa.query(User).get(user.user_id) |
|
115 | ||
|
116 | if dbuser: | |
|
116 | 117 | user.username = dbuser.username |
|
117 | 118 | user.is_admin = dbuser.admin |
|
118 | 119 | user.name = dbuser.name |
|
119 | 120 | user.lastname = dbuser.lastname |
|
120 | ||
|
121 | else: | |
|
122 | user.is_authenticated = False | |
|
121 | 123 | meta.Session.remove() |
|
122 | 124 | return user |
|
123 | 125 |
General Comments 0
You need to be logged in to leave comments.
Login now