Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
2fa80706
Commit
2fa80706
authored
Oct 30, 2015
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle toke expiry in timezone aware timestamp
Issue #892 Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
fd988745
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
weblate/trans/machine/microsoft.py
weblate/trans/machine/microsoft.py
+4
-3
No files found.
weblate/trans/machine/microsoft.py
View file @
2fa80706
...
...
@@ -18,7 +18,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from
datetime
import
datetime
,
timedelta
from
datetime
import
timedelta
from
django.utils
import
timezone
from
weblate.trans.machine.base
import
(
MachineTranslation
,
MachineTranslationError
,
MissingConfiguration
)
...
...
@@ -62,7 +63,7 @@ class MicrosoftTranslation(MachineTranslation):
'''
Checks whether token is about to expire.
'''
return
self
.
_token_expiry
<=
datetim
e
.
now
()
return
self
.
_token_expiry
<=
timezon
e
.
now
()
@
property
def
access_token
(
self
):
...
...
@@ -87,7 +88,7 @@ class MicrosoftTranslation(MachineTranslation):
)
self
.
_access_token
=
data
[
'access_token'
]
self
.
_token_expiry
=
datetim
e
.
now
()
+
TOKEN_EXPIRY
self
.
_token_expiry
=
timezon
e
.
now
()
+
TOKEN_EXPIRY
return
self
.
_access_token
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment