Skip to content

Commit

Permalink
satisy finter w. make fix"
Browse files Browse the repository at this point in the history
  • Loading branch information
owocki committed Sep 21, 2019
1 parent 5096cec commit 787044a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
8 changes: 2 additions & 6 deletions app/app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,7 @@
dashboard.views.social_contribution_email,
name='social_contribution_email'
),
url(
r'^api/v0.1/bulk_invite',
dashboard.views.bulk_invite,
name='bulk_invite'
),
url(r'^api/v0.1/bulk_invite', dashboard.views.bulk_invite, name='bulk_invite'),
url(r'^api/v0.1/bountydocument', dashboard.views.bounty_upload_nda, name='bounty_upload_nda'),
url(r'^api/v0.1/faucet/save/?', faucet.views.save_faucet, name='save_faucet'),
url(r'^api/v0.1/', include(dbrouter.urls)),
Expand Down Expand Up @@ -491,7 +487,7 @@
retail.emails.no_applicant_reminder,
name='no_applicant_reminder'
),

# settings
re_path(r'^settings/email/(.*)', marketing.views.email_settings, name='email_settings'),
re_path(r'^settings/privacy/?', marketing.views.privacy_settings, name='privacy_settings'),
Expand Down
34 changes: 19 additions & 15 deletions app/assets/v2/js/grants/fund.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,27 +509,31 @@ const lerp = (x_lower, x_upper, y_lower, y_upper, x) => {
const predictPhantomCLRMatch = () => {

let amount = phantom_value;
if (typeof clr_prediction_curve_per_grant == 'undefined'){

if (typeof clr_prediction_curve_per_grant == 'undefined') {
return;
}
for (var grant_id in clr_prediction_curve_per_grant) {
if (grant_id) {
var curve_per_grant = clr_prediction_curve_per_grant[grant_id].map(function(value, index) {
return value[1];
});

var curve_per_grant = clr_prediction_curve_per_grant[grant_id].map(function(value,index) { return value[1]; });
if (0 <= amount && amount <= 1) {
x_lower = 0;
x_upper = 1;
y_lower = curve_per_grant[0];
y_upper = curve_per_grant[1];
} else if (1 < amount && amount <= 10) {
x_lower = 1;
x_upper = 10;
y_lower = curve_per_grant[1];
y_upper = curve_per_grant[2];
}
let predicted_clr = lerp(x_lower, x_upper, y_lower, y_upper, amount);

if (0 <= amount && amount <= 1) {
x_lower = 0;
x_upper = 1;
y_lower = curve_per_grant[0];
y_upper = curve_per_grant[1];
} else if (1 < amount && amount <= 10) {
x_lower = 1;
x_upper = 10;
y_lower = curve_per_grant[1];
y_upper = curve_per_grant[2];
$('.phantom_clr_increase' + grant_id).html((predicted_clr - curve_per_grant[0]).toFixed(2));
}
let predicted_clr = lerp(x_lower, x_upper, y_lower, y_upper, amount);

$('.phantom_clr_increase' + grant_id).html((predicted_clr - curve_per_grant[0]).toFixed(2));
}
};

Expand Down
2 changes: 1 addition & 1 deletion app/dashboard/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import collections
import logging
from datetime import datetime, timedelta
from decimal import Decimal
from urllib.parse import urlsplit

from django.conf import settings
Expand All @@ -41,7 +42,6 @@
from django.utils import timezone
from django.utils.translation import gettext_lazy as _

from decimal import Decimal
import pytz
import requests
from app.utils import get_upload_filename
Expand Down

0 comments on commit 787044a

Please sign in to comment.