コード例 #1
0
def addSolution(request):
    """Start working on this issue"""
    issue_id = int(request.POST["issue_id"])
    comment_content = request.POST["comment"]
    accepting_payments = request.POST.has_key("accept_payments")
    solution, comment = issue_services.add_solution_to_existing_issue(
        issue_id, comment_content, accepting_payments, request.user
    )
    watch_services.watch_issue(request.user, solution.issue.id, Watch.STARTED_WORKING)
    ActionLog.log_start_work(solution=solution, issue_comment=comment)
    need_bitcoin_address = _need_to_set_bitcoin_address(request.user, solution.issue)
    need_verify_paypal = _need_to_verify_paypal_account(request.user, solution.issue)
    if need_bitcoin_address:
        msg = """You just began working on an issue with a Bitcoin offer.
You need to configure a Bitcoin address on your user profile, otherwise the sponsor will not be able to pay his offer to you.
You can set your bitcoin address in your 'edit profile' page."""
        messages.error(request, msg)
    if need_verify_paypal:
        msg = (
            """You just began working on an issue with an offer in USD.
FS has detected that the email '%s' is not associated with a verified Paypal account.
You need to have a verified Paypal account before you can receive payments through Paypal."""
            % request.user.getUserInfo().paypalEmail
        )
        messages.error(request, msg)
    return redirect(solution.issue.get_view_link())
コード例 #2
0
def addSolution(request):
    """Start working on this issue"""
    issue_id = int(request.POST['issue_id'])
    comment_content = request.POST['comment']
    issue = issue_services.add_solution_to_existing_issue(issue_id, comment_content, request.user)
    watch_services.watch_issue(request.user, issue.id, IssueWatch.STARTED_WORKING)
    return redirect(issue.get_view_link())
コード例 #3
0
def addIssueComment(request):
    issue_id = int(request.POST['issue_id'])
    comment_content = request.POST['content']
    watch_services.watch_issue(request.user, issue_id, IssueWatch.COMMENTED)
    issue = comment_services.add_comment_to_issue(issue_id, comment_content,
                                                  request.user)
    return redirect(issue.get_view_link())
コード例 #4
0
def addSolution(request):
    """Start working on this issue"""
    issue_id = int(request.POST['issue_id'])
    comment_content = request.POST['comment']
    accepting_payments = request.POST.has_key('accept_payments')
    solution, comment = issue_services.add_solution_to_existing_issue(
        issue_id, comment_content, accepting_payments, request.user)
    watch_services.watch_issue(request.user, solution.issue.id,
                               Watch.STARTED_WORKING)
    ActionLog.log_start_work(solution=solution, issue_comment=comment)
    need_bitcoin_address = _need_to_set_bitcoin_address(
        request.user, solution.issue)
    need_verify_paypal = _need_to_verify_paypal_account(
        request.user, solution.issue)
    if need_bitcoin_address:
        msg = """You just began working on an issue with a Bitcoin offer.
You need to configure a Bitcoin address on your user profile, otherwise the sponsor will not be able to pay his offer to you.
You can set your bitcoin address in your 'edit profile' page."""
        messages.error(request, msg)
    if need_verify_paypal:
        msg = """You just began working on an issue with an offer in USD.
FS has detected that the email '%s' is not associated with a verified Paypal account.
You need to have a verified Paypal account before you can receive payments through Paypal.""" % request.user.getUserInfo(
        ).paypalEmail
        messages.error(request, msg)
    return redirect(solution.issue.get_view_link())
コード例 #5
0
def addSolution(request):
    """Start working on this issue"""
    issue_id = int(request.POST["issue_id"])
    comment_content = request.POST["comment"]
    accepting_payments = request.POST.has_key("accept_payments")
    issue = issue_services.add_solution_to_existing_issue(issue_id, comment_content, accepting_payments, request.user)
    watch_services.watch_issue(request.user, issue.id, IssueWatch.STARTED_WORKING)
    return redirect(issue.get_view_link())
コード例 #6
0
def kickstartIssue(request):
    try:
        issue = issue_services.kickstart_new_issue(request.POST, request.user)
        watch_services.watch_issue(request.user, issue.id, IssueWatch.CREATED)
    except BaseException as ex:
        return HttpResponse(_("ERROR: ")+ex.message)

    params= '?alert=KICKSTART'
    return redirect(issue.get_view_link()+params)
コード例 #7
0
def addIssue(request):
    try:
        offer = issue_services.sponsor_new_issue(request.POST, request.user)
        watch_services.watch_issue(request.user, offer.issue.id, IssueWatch.SPONSORED)
    except BaseException as ex:
        traceback.print_exc()
        return HttpResponse(_("ERROR: ") + ex.message)
    params = "?alert=SPONSOR"
    to = offer if template_folder(request) == "core/" else offer.issue
    return redirect(to.get_view_link() + params)
コード例 #8
0
def sponsorIssue(request):
    issue_id = int(request.POST['issue_id'])

    issue = Issue.objects.get(pk=issue_id)
    offer = issue_services.sponsor_existing_issue(issue_id, request.POST, request.user)
    watch_services.watch_issue(request.user, issue_id, Watch.SPONSORED)
    ActionLog.log_sponsor(offer)
    if issue.getSolutionsAcceptingPayments().count() > 0:
        messages.info(request, 'This issue is open for payments. You are free to choose: you can pay now, or you can wait until after the issue is finished. No pressure :-)')
    return redirect(offer.issue.get_view_link() + '?alert=SPONSOR')
コード例 #9
0
def kickstartIssue(request):
    try:
        issue = issue_services.kickstart_new_issue(request.POST, request.user)
        watch_services.watch_issue(request.user, issue.id, IssueWatch.CREATED)
    except BaseException as ex:
        traceback.print_exc()
        return HttpResponse(_("ERROR: ") + ex.message)

    params = '?alert=KICKSTART'
    return redirect(issue.get_view_link() + params)
コード例 #10
0
def addIssue(request):
    try:
        offer = issue_services.sponsor_new_issue(request.POST, request.user)
        watch_services.watch_issue(request.user, offer.issue.id,
                                   IssueWatch.SPONSORED)
    except BaseException as ex:
        traceback.print_exc()
        return HttpResponse(_("ERROR: ") + ex.message)
    params = '?alert=SPONSOR'
    to = offer if template_folder(request) == 'core/' else offer.issue
    return redirect(to.get_view_link() + params)
コード例 #11
0
def addFeedback(request):
    dict = request.POST
    issue_title = dict['title']
    issue_description = dict['description']
    if not issue_title or not issue_description:
        raise BaseException(_('title and description are required'))
    issue = Issue.newIssueFeedback(issue_title, issue_description, request.user)
    issue.save()
    watch_services.watch_issue(request.user, issue.id, Watch.CREATED)
    notify_admin(_('new Feedback: %s') % issue_title, issue_description)
    return redirect('feedback')
コード例 #12
0
def addIssue(request):
    try:
        offer = issue_services.sponsor_new_issue(request.POST, request.user)
        watch_services.watch_issue(request.user, offer.issue.id, IssueWatch.SPONSORED)
    except BaseException as ex:
        return HttpResponse(_("ERROR: ")+ex.message)
    params = '?alert=SPONSOR'
    if(dictOrEmpty(request.POST, 'invoke_parent_callback') == 'true'):
        params += '&c=s' # c = Callback (iframe javascript callback)

    return redirect(offer.get_view_link()+params)
コード例 #13
0
    def test_watch_toggle_issue(self):
        issue = test_data.create_dummy_issue()
        user = issue.createdByUser

        self.assertTrue(not watch_services.is_watching_issue(user, issue.id))

        watch_services.watch_issue(user, issue.id, Watch.WATCHED)
        self.assertTrue(watch_services.is_watching_issue(user, issue.id))

        watch_services.toggle_watch(user, 'ISSUE', issue.id, Watch.WATCHED)
        self.assertTrue(not watch_services.is_watching_issue(user, issue.id))
コード例 #14
0
def addFeedback(request):
    dict = request.POST
    issue_title = dict["title"]
    issue_description = dict["description"]
    if not issue_title or not issue_description:
        raise BaseException(_("title and description are required"))
    issue = Issue.newIssueFeedback(issue_title, issue_description, request.user)
    issue.save()
    watch_services.watch_issue(request.user, issue.id, Watch.CREATED)
    notify_admin(_("new Feedback: %s") % issue_title, issue_description)
    return redirect("core.views.feedback_views.feedback")
コード例 #15
0
def addFeedback(request):
    dict = request.POST
    issue_title = dict['title']
    issue_description = dict['description']
    if not issue_title or not issue_description:
        raise BaseException(_('title and description are required'))
    issue = Issue.newIssueFeedback(issue_title, issue_description, request.user)
    issue.save()
    watch_services.watch_issue(request.user, issue.id, Watch.CREATED)
    notify_admin(_('new Feedback: %s') % issue_title, issue_description)
    return redirect('core.views.feedback_views.feedback')
コード例 #16
0
    def test_watch_toggle_issue(self):
        issue = test_data.create_dummy_issue()
        user = issue.createdByUser

        self.assertTrue(not watch_services.is_watching_issue(user, issue.id))

        watch_services.watch_issue(user, issue.id, IssueWatch.WATCHED)
        self.assertTrue(watch_services.is_watching_issue(user, issue.id))

        watch_services.unwatch_issue(user, issue.id)
        self.assertTrue(not watch_services.is_watching_issue(user, issue.id))
コード例 #17
0
def sponsorIssue(request):
    issue_id = int(request.POST['issue_id'])

    offer = issue_services.sponsor_existing_issue(issue_id, request.POST, request.user)
    watch_services.watch_issue(request.user, issue_id, IssueWatch.SPONSORED)

    invoke_parent_callback = dictOrEmpty(request.POST, 'invoke_parent_callback')
    if(invoke_parent_callback == 'true'):
        params = '?c=s' # c = Callback (iframe javascript callback)
    else:
        params = '?alert=SPONSOR' # a = Alert
    return redirect(offer.get_view_link()+params)
コード例 #18
0
def addIssue(request):
    try:
        offer = issue_services.sponsor_new_issue(request.POST, request.user)
        watch_services.watch_issue(request.user, offer.issue.id,
                                   IssueWatch.SPONSORED)
    except BaseException as ex:
        traceback.print_exc()
        return HttpResponse(_("ERROR: ") + ex.message)
    params = '?alert=SPONSOR'
    if (dictOrEmpty(request.POST, 'invoke_parent_callback') == 'true'):
        params += '&c=s'  # c = Callback (iframe javascript callback)

    return redirect(offer.get_view_link() + params)
コード例 #19
0
 def test_process_ipn_return(self):
     payment = test_data.create_dummy_payment_usd()
     watcher = test_data.create_dummy_programmer()
     watch_services.watch_issue(watcher, payment.offer.issue.id, IssueWatch.WATCHED)
     email_asserts.clear_sent()
     paypal_services.process_ipn_return(payment.paykey, 'COMPLETED', 'abcd1234')
     payment = Payment.objects.get(id=payment.id);
     self.assertEquals(Payment.CONFIRMED_IPN, payment.status)
     email_asserts.send_emails()
     email_asserts.assert_sent_count(self, 4)
     email_asserts.assert_sent(self, to=payment.offer.sponsor.email, subject="You have made a US$ 10.00 payment")
     email_asserts.assert_sent(self, to=payment.getParts()[0].programmer.email, subject="User One has made you a US$ 10.00 payment")
     email_asserts.assert_sent(self, to=watcher.email, subject="User One has paid his offer [US$ 10.00 / Compiled native SQL queries are not cached]")
     email_asserts.assert_sent(self, to=settings.ADMINS[0][1], subject="payment confirmed: [US$ 10.00 / Compiled native SQL queries are not cached]")
コード例 #20
0
def sponsorIssue(request):
    issue_id = int(request.POST['issue_id'])

    issue = Issue.objects.get(pk = issue_id)
    offer = issue_services.sponsor_existing_issue(issue_id, request.POST, request.user)
    watch_services.watch_issue(request.user, issue_id, IssueWatch.SPONSORED)

    invoke_parent_callback = request.POST.get('invoke_parent_callback')
    if(invoke_parent_callback == 'true'):
        params = '?c=s' # c = Callback (iframe javascript callback)
    else:
        params = '?alert=SPONSOR' # a = Alert
    if (issue.getSolutionsAcceptingPayments().count() > 0):
        messages.info(request, 'This issue is open for payments. You are free to choose: you can pay now, or you can wait until after the issue is finished. No pressure :-)')
    return redirect(offer.get_view_link()+params)
コード例 #21
0
def sponsorIssue(request):
    issue_id = int(request.POST["issue_id"])

    issue = Issue.objects.get(pk=issue_id)
    offer = issue_services.sponsor_existing_issue(issue_id, request.POST, request.user)
    watch_services.watch_issue(request.user, issue_id, IssueWatch.SPONSORED)

    invoke_parent_callback = dictOrEmpty(request.POST, "invoke_parent_callback")
    if invoke_parent_callback == "true":
        params = "?c=s"  # c = Callback (iframe javascript callback)
    else:
        params = "?alert=SPONSOR"  # a = Alert
    if issue.getSolutionsAcceptingPayments().count() > 0:
        messages.info(
            request,
            "This issue is open for payments. You are free to choose: you can pay now, or you can wait until after the issue is finished. No pressure :-)",
        )
    return redirect(offer.get_view_link() + params)
コード例 #22
0
def sponsorIssue(request):
    issue_id = int(request.POST['issue_id'])

    issue = Issue.objects.get(pk=issue_id)
    offer = issue_services.sponsor_existing_issue(issue_id, request.POST,
                                                  request.user)
    watch_services.watch_issue(request.user, issue_id, IssueWatch.SPONSORED)

    invoke_parent_callback = request.POST.get('invoke_parent_callback')
    if (invoke_parent_callback == 'true'):
        params = '?c=s'  # c = Callback (iframe javascript callback)
    else:
        params = '?alert=SPONSOR'  # a = Alert
    if (issue.getSolutionsAcceptingPayments().count() > 0):
        messages.info(
            request,
            'This issue is open for payments. You are free to choose: you can pay now, or you can wait until after the issue is finished. No pressure :-)'
        )
    return redirect(offer.get_view_link() + params)
コード例 #23
0
def watchIssue(request, issue_id):
    watch_services.watch_issue(request.user, int(issue_id), Watch.WATCHED)
    return HttpResponse('WATCHING')
コード例 #24
0
def kickstartIssue(request):
    issue = issue_services.kickstart_new_issue(request.POST, request.user)
    watch_services.watch_issue(request.user, issue.id, Watch.CREATED)
    ActionLog.log_propose(issue=issue, user=request.user)
    return redirect(issue.get_view_link() + '?alert=KICKSTART')
コード例 #25
0
def addIssue(request):
    offer = issue_services.sponsor_new_issue(request.POST, request.user)
    watch_services.watch_issue(request.user, offer.issue.id, Watch.SPONSORED)
    ActionLog.log_sponsor(offer)
    return redirect(offer.issue.get_view_link() + '?alert=SPONSOR')
コード例 #26
0
def watchIssue(request, issue_id):
    watch_services.watch_issue(request.user, int(issue_id), IssueWatch.WATCHED)
    return HttpResponse('WATCHING')
コード例 #27
0
def kickstartIssue(request):
    issue = issue_services.kickstart_new_issue(request.POST, request.user)
    watch_services.watch_issue(request.user, issue.id, Watch.CREATED)
    ActionLog.log_propose(issue=issue, user=request.user)
    return redirect(issue.get_view_link() + '?alert=KICKSTART')
コード例 #28
0
def addIssue(request):
    offer = issue_services.sponsor_new_issue(request.POST, request.user)
    watch_services.watch_issue(request.user, offer.issue.id, Watch.SPONSORED)
    ActionLog.log_sponsor(offer)
    return redirect(offer.issue.get_view_link() + '?alert=SPONSOR')
コード例 #29
0
def addIssueComment(request):
    issue_id = int(request.POST['issue_id'])
    comment_content = request.POST['content']
    watch_services.watch_issue(request.user, issue_id, Watch.COMMENTED)
    issue = comment_services.add_comment_to_issue(issue_id, comment_content, request.user)
    return redirect(issue.get_view_link())