Merge branch 'hotfix'
This commit is contained in:
commit
5ce9cb20c4
5 changed files with 17 additions and 12 deletions
|
|
@ -13,7 +13,7 @@ import os, sys, importlib, inspect, json
|
|||
from .exceptions import *
|
||||
from .utils.jinja import get_jenv, get_template, render_template
|
||||
|
||||
__version__ = '7.2.17'
|
||||
__version__ = '7.2.18'
|
||||
__title__ = "Frappe Framework"
|
||||
|
||||
local = Local()
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ class WebApplicationServer(AuthorizationEndpoint, TokenEndpoint, ResourceEndpoin
|
|||
:param kwargs: Extra parameters to pass to authorization-,
|
||||
token-, resource-, and revocation-endpoint constructors.
|
||||
"""
|
||||
implicit_grant = ImplicitGrant(request_validator)
|
||||
auth_grant = AuthorizationCodeGrant(request_validator)
|
||||
refresh_grant = RefreshTokenGrant(request_validator)
|
||||
openid_connect_auth = OpenIDConnectAuthCode(request_validator)
|
||||
|
|
@ -48,6 +49,7 @@ class WebApplicationServer(AuthorizationEndpoint, TokenEndpoint, ResourceEndpoin
|
|||
'code token': openid_connect_auth,
|
||||
'code id_token': openid_connect_auth,
|
||||
'code token id_token': openid_connect_auth,
|
||||
'token': implicit_grant
|
||||
},
|
||||
default_token_type=bearer)
|
||||
TokenEndpoint.__init__(self, default_grant_type='authorization_code',
|
||||
|
|
@ -205,7 +207,7 @@ class OAuthWebRequestValidator(RequestValidator):
|
|||
otoken.user = request.user
|
||||
otoken.scopes = get_url_delimiter().join(request.scopes)
|
||||
otoken.access_token = token['access_token']
|
||||
otoken.refresh_token = token['refresh_token']
|
||||
otoken.refresh_token = token.get('refresh_token')
|
||||
otoken.expires_in = token['expires_in']
|
||||
otoken.save(ignore_permissions=True)
|
||||
frappe.db.commit()
|
||||
|
|
|
|||
|
|
@ -713,17 +713,17 @@ frappe.ui.form.ControlDatetime = frappe.ui.form.ControlDate.extend({
|
|||
});
|
||||
|
||||
frappe.ui.form.ControlDateRange = frappe.ui.form.ControlData.extend({
|
||||
|
||||
|
||||
make_input: function() {
|
||||
var me = this
|
||||
var me = this;
|
||||
var _super = this._super;
|
||||
_super.apply(me);
|
||||
import_daterangepicker(function() {
|
||||
|
||||
|
||||
me.refresh();
|
||||
me.set_daterangepicker();
|
||||
|
||||
|
||||
});
|
||||
},
|
||||
set_daterangepicker: function() {
|
||||
|
|
@ -758,7 +758,7 @@ frappe.ui.form.ControlDateRange = frappe.ui.form.ControlData.extend({
|
|||
'Last Financial Year': [moment(frappe.defaults.get_default("year_start_date"), "YYYY-MM-DD").subtract(1, 'year'), moment(frappe.defaults.get_default("year_end_date"), "YYYY-MM-DD").subtract(1, 'year')]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.$input.daterangepicker(daterangepicker_options)
|
||||
.on('apply.daterangepicker',function(ev,picker){
|
||||
me.set_input(picker.startDate,picker.endDate)
|
||||
|
|
@ -787,7 +787,7 @@ frappe.ui.form.ControlDateRange = frappe.ui.form.ControlData.extend({
|
|||
this.$input && this.$input.val("")
|
||||
}
|
||||
this.set_disp_area();
|
||||
|
||||
|
||||
this.set_mandatory && this.set_mandatory(value);
|
||||
},
|
||||
parse: function(value) {
|
||||
|
|
@ -797,7 +797,7 @@ frappe.ui.form.ControlDateRange = frappe.ui.form.ControlData.extend({
|
|||
value2 = dateutil.user_to_obj(vals[vals.length-1]);
|
||||
return [value,value2];
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
format_for_input: function(value,value2) {
|
||||
if(value && value2) {
|
||||
|
|
@ -805,7 +805,7 @@ frappe.ui.form.ControlDateRange = frappe.ui.form.ControlData.extend({
|
|||
value2 = dateutil.str_to_user(value2);
|
||||
return value + " - " + value2
|
||||
}
|
||||
|
||||
|
||||
return "";
|
||||
},
|
||||
validate: function(value, callback) {
|
||||
|
|
@ -1423,7 +1423,7 @@ frappe.ui.form.ControlLink = frappe.ui.form.ControlData.extend({
|
|||
ui.item.action.apply(me);
|
||||
}
|
||||
|
||||
// if remember_last_selected is checked in the doctype against the field,
|
||||
// if remember_last_selected is checked in the doctype against the field,
|
||||
// then add this value
|
||||
// to defaults so you do not need to set it again
|
||||
// unless it is changed.
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ frappe.form.formatters = {
|
|||
if(value) {
|
||||
return '<i class="octicon octicon-check" style="margin-right: 3px;"></i>';
|
||||
} else {
|
||||
return '<i class="fa fa-ban-circle text-extra-muted" style="margin-right: 3px;"></i>';
|
||||
return '<i class="fa fa-circle-o text-extra-muted" style="margin-right: 3px; margin-bottom: -2px;"></i>';
|
||||
}
|
||||
},
|
||||
Link: function(value, docfield, options, doc) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ from __future__ import unicode_literals
|
|||
# IMPORTANT: only import safe functions as this module will be included in jinja environment
|
||||
import frappe
|
||||
import operator
|
||||
import re, urllib, datetime, math
|
||||
import re, urllib, datetime, math, time
|
||||
import babel.dates
|
||||
from babel.core import UnknownLocaleError
|
||||
from dateutil import parser
|
||||
|
|
@ -117,6 +117,9 @@ def now_datetime():
|
|||
dt = convert_utc_to_user_timezone(datetime.datetime.utcnow())
|
||||
return dt.replace(tzinfo=None)
|
||||
|
||||
def get_timestamp(date):
|
||||
return time.mktime(getdate(date).timetuple())
|
||||
|
||||
def get_eta(from_time, percent_complete):
|
||||
diff = time_diff(now_datetime(), from_time).total_seconds()
|
||||
return str(datetime.timedelta(seconds=(100 - percent_complete) / percent_complete * diff))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue