Ejemplo n.º 1
0
def collection_options_post_(request):
    form = request.web_input(allow_request="", allow_notification="")

    jsonb_settings = define.get_profile_settings(request.userid)
    jsonb_settings.allow_collection_requests = form.allow_request
    jsonb_settings.allow_collection_notifs = form.allow_notification

    profile.edit_preferences(request.userid, jsonb_settings=jsonb_settings)
    raise HTTPSeeOther(location="/control")
Ejemplo n.º 2
0
def collection_options_post_(request):
    form = request.web_input(allow_request="", allow_notification="")

    jsonb_settings = define.get_profile_settings(request.userid)
    jsonb_settings.allow_collection_requests = form.allow_request
    jsonb_settings.allow_collection_notifs = form.allow_notification

    profile.edit_preferences(request.userid, jsonb_settings=jsonb_settings)
    raise HTTPSeeOther(location="/control")
Ejemplo n.º 3
0
    def POST(self):
        form = web.input(allow_request="", allow_notification="")

        jsonb_settings = define.get_profile_settings(self.user_id)
        jsonb_settings.allow_collection_requests = form.allow_request
        jsonb_settings.allow_collection_notifs = form.allow_notification

        profile.edit_preferences(self.user_id, jsonb_settings=jsonb_settings)
        raise web.seeother("/control")
Ejemplo n.º 4
0
    def POST(self):
        form = web.input(allow_request="", allow_notification="")

        jsonb_settings = define.get_profile_settings(self.user_id)
        jsonb_settings.allow_collection_requests = form.allow_request
        jsonb_settings.allow_collection_notifs = form.allow_notification

        profile.edit_preferences(self.user_id, jsonb_settings=jsonb_settings)
        raise web.seeother("/control")
Ejemplo n.º 5
0
    def POST(self):
        form = web.input(rating="",
                         sfwrating="",
                         custom_thumbs="",
                         tagging="",
                         edittagging="",
                         hideprofile="",
                         hidestats="",
                         hidefavorites="",
                         hidefavbar="",
                         shouts="",
                         notes="",
                         filter="",
                         follow_s="",
                         follow_c="",
                         follow_f="",
                         follow_t="",
                         follow_j="",
                         timezone="",
                         twelvehour="")

        rating = ratings.CODE_MAP[define.get_int(form.rating)]
        jsonb_settings = define.get_profile_settings(self.user_id)
        jsonb_settings.disable_custom_thumbs = form.custom_thumbs == "disable"
        jsonb_settings.max_sfw_rating = define.get_int(form.sfwrating)

        preferences = profile.Config()
        preferences.twelvehour = bool(form.twelvehour)
        preferences.rating = rating
        preferences.tagging = bool(form.tagging)
        preferences.edittagging = bool(form.edittagging)
        preferences.hideprofile = bool(form.hideprofile)
        preferences.hidestats = bool(form.hidestats)
        preferences.hidefavorites = bool(form.hidefavorites)
        preferences.hidefavbar = bool(form.hidefavbar)
        preferences.shouts = ("friends_only" if form.shouts == "x" else
                              "staff_only" if form.shouts == "w" else "anyone")
        preferences.notes = ("friends_only" if form.notes == "z" else
                             "staff_only" if form.notes == "y" else "anyone")
        preferences.filter = bool(form.filter)
        preferences.follow_s = bool(form.follow_s)
        preferences.follow_c = bool(form.follow_c)
        preferences.follow_f = bool(form.follow_f)
        preferences.follow_t = bool(form.follow_t)
        preferences.follow_j = bool(form.follow_j)

        profile.edit_preferences(self.user_id,
                                 timezone=form.timezone,
                                 preferences=preferences,
                                 jsonb_settings=jsonb_settings)
        # release the cache on the index page in case the Maximum Viewable Content Rating changed.
        index.template_fields.invalidate(self.user_id)
        raise web.seeother("/control")
Ejemplo n.º 6
0
def control_editpreferences_post_(request):
        form = request.web_input(
            rating="", sfwrating="", custom_thumbs="", tagging="", edittagging="",
            hideprofile="", hidestats="", hidefavorites="", hidefavbar="",
            shouts="", notes="", filter="",
            follow_s="", follow_c="", follow_f="", follow_t="",
            follow_j="", timezone="", twelvehour="")

        rating = ratings.CODE_MAP[define.get_int(form.rating)]
        jsonb_settings = define.get_profile_settings(request.userid)
        jsonb_settings.disable_custom_thumbs = form.custom_thumbs == "disable"
        jsonb_settings.max_sfw_rating = define.get_int(form.sfwrating)

        preferences = profile.Config()
        preferences.twelvehour = bool(form.twelvehour)
        preferences.rating = rating
        preferences.tagging = bool(form.tagging)
        preferences.edittagging = bool(form.edittagging)
        preferences.hideprofile = bool(form.hideprofile)
        preferences.hidestats = bool(form.hidestats)
        preferences.hidefavorites = bool(form.hidefavorites)
        preferences.hidefavbar = bool(form.hidefavbar)
        preferences.shouts = ("friends_only" if form.shouts == "x" else
                              "staff_only" if form.shouts == "w" else "anyone")
        preferences.notes = ("friends_only" if form.notes == "z" else
                             "staff_only" if form.notes == "y" else "anyone")
        preferences.filter = bool(form.filter)
        preferences.follow_s = bool(form.follow_s)
        preferences.follow_c = bool(form.follow_c)
        preferences.follow_f = bool(form.follow_f)
        preferences.follow_t = bool(form.follow_t)
        preferences.follow_j = bool(form.follow_j)

        profile.edit_preferences(request.userid, timezone=form.timezone,
                                 preferences=preferences, jsonb_settings=jsonb_settings)
        # release the cache on the index page in case the Maximum Viewable Content Rating changed.
        index.template_fields.invalidate(request.userid)
        raise HTTPSeeOther(location="/control")