def control_editpreferences_get_(request): config = define.get_config(request.userid) current_rating, current_sfw_rating = define.get_config_rating(request.userid) age = profile.get_user_age(request.userid) allowed_ratings = ratings.get_ratings_for_age(age) jsonb_settings = define.get_profile_settings(request.userid) return Response(define.webpage(request.userid, "control/edit_preferences.html", [ # Config config, jsonb_settings, # Rating current_rating, current_sfw_rating, age, allowed_ratings, request.weasyl_session.timezone.timezone, define.timezones(), ], title="Site Preferences"))
def control_editpreferences_get_(request): config = define.get_config(request.userid) current_rating, current_sfw_rating = define.get_config_rating(request.userid) age = profile.get_user_age(request.userid) allowed_ratings = ratings.get_ratings_for_age(age) jsonb_settings = define.get_profile_settings(request.userid) return Response(define.webpage(request.userid, "control/edit_preferences.html", [ # Config config, jsonb_settings, # Rating current_rating, current_sfw_rating, age, allowed_ratings, request.weasyl_session.timezone.timezone, define.timezones(), ]))
def GET(self): config = define.get_config(self.user_id) current_rating, current_sfw_rating = define.get_config_rating(self.user_id) age = profile.get_user_age(self.user_id) allowed_ratings = ratings.get_ratings_for_age(age) jsonb_settings = define.get_profile_settings(self.user_id) return define.webpage(self.user_id, "control/edit_preferences.html", [ # Config config, jsonb_settings, # Rating current_rating, current_sfw_rating, age, allowed_ratings, web.ctx.weasyl_session.timezone.timezone, define.timezones(), ])
def GET(self): config = define.get_config(self.user_id) current_rating, current_sfw_rating = define.get_config_rating( self.user_id) age = profile.get_user_age(self.user_id) allowed_ratings = ratings.get_ratings_for_age(age) jsonb_settings = define.get_profile_settings(self.user_id) return define.webpage( self.user_id, "control/edit_preferences.html", [ # Config config, jsonb_settings, # Rating current_rating, current_sfw_rating, age, allowed_ratings, web.ctx.weasyl_session.timezone.timezone, define.timezones(), ])
def get_user_ratings(userid): return ratings.get_ratings_for_age(get_user_age(userid))
def get_user_ratings(userid): return ratings.get_ratings_for_age(get_user_age(userid))
def test_get_ratings_for_age(age, expected): assert ratings.get_ratings_for_age(age) == expected