コード例 #1
0
ファイル: weasyl_collections.py プロジェクト: Syfaro/weasyl
def collection_offer_(request):
    form = request.web_input(submitid="", username="")
    form.otherid = profile.resolve(None, None, form.username)
    form.submitid = int(form.submitid)

    if not form.otherid:
        raise WeasylError("userRecordMissing")
    if request.userid == form.otherid:
        raise WeasylError("cannotSelfCollect")

    collection.offer(request.userid, form.submitid, form.otherid)
    return Response(define.errorpage(
        request.userid,
        "**Success!** Your collection offer has been sent "
        "and the recipient may now add this submission to their gallery.",
        [["Go Back", "/submission/%i" % (form.submitid,)], ["Return to the Home Page", "/index"]]))
コード例 #2
0
def collection_offer_(request):
    form = request.web_input(submitid="", username="")
    form.otherid = profile.resolve(None, None, form.username)
    form.submitid = int(form.submitid)

    if not form.otherid:
        raise WeasylError("userRecordMissing")
    if request.userid == form.otherid:
        raise WeasylError("cannotSelfCollect")

    collection.offer(request.userid, form.submitid, form.otherid)
    return Response(define.errorpage(
        request.userid,
        "**Success!** Your collection offer has been sent "
        "and the recipient may now add this submission to their gallery.",
        [["Go Back", "/submission/%i" % (form.submitid,)], ["Return to the Home Page", "/index"]]))
コード例 #3
0
 def offer(self):
     collection.offer(self.creator, self.s, self.collector)
コード例 #4
0
ファイル: test_collection.py プロジェクト: 0x15/weasyl
 def offer(self):
     collection.offer(self.creator, self.s, self.collector)