##// END OF EJS Templates
notifications: store notification status in channelstream
ergo -
r734:1eb83256 default
parent child Browse files
Show More
@@ -365,9 +365,7 b' class MyAccountController(BaseController'
365 @jsonify
365 @jsonify
366 def my_notifications_toggle_visibility(self):
366 def my_notifications_toggle_visibility(self):
367 user = c.rhodecode_user.get_instance()
367 user = c.rhodecode_user.get_instance()
368 user_data = user.user_data
368 new_status = not user.user_data.get('notification_status', True)
369 status = user_data.get('notification_status', False)
369 user.update_userdata(notification_status=new_status)
370 user_data['notification_status'] = not status
371 user.user_data = user_data
372 Session().commit()
370 Session().commit()
373 return user_data['notification_status']
371 return user.user_data['notification_status']
@@ -84,6 +84,7 b' def get_user_data(user_id):'
84 'icon_link': h.gravatar_url(user.email, 14),
84 'icon_link': h.gravatar_url(user.email, 14),
85 'display_name': h.person(user, 'username_or_name_or_email'),
85 'display_name': h.person(user, 'username_or_name_or_email'),
86 'display_link': h.link_to_user(user),
86 'display_link': h.link_to_user(user),
87 'notifications': user.user_data.get('notification_status', True)
87 }
88 }
88
89
89
90
@@ -314,6 +314,7 b' class UserModel(BaseModel):'
314 new_user.update_userdata(force_password_change=True)
314 new_user.update_userdata(force_password_change=True)
315 if language:
315 if language:
316 new_user.update_userdata(language=language)
316 new_user.update_userdata(language=language)
317 new_user.update_userdata(notification_status=True)
317
318
318 self.sa.add(new_user)
319 self.sa.add(new_user)
319
320
General Comments 0
You need to be logged in to leave comments. Login now