Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Hiboo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ACIDES
Hiboo
Commits
65a90265
Commit
65a90265
authored
4 years ago
by
kaiyou
Browse files
Options
Downloads
Patches
Plain Diff
Add a (wrong) transition delta computation
parent
b85aa30b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hiboo/models.py
+5
-0
5 additions, 0 deletions
hiboo/models.py
with
5 additions
and
0 deletions
hiboo/models.py
+
5
−
0
View file @
65a90265
...
@@ -5,6 +5,7 @@ from datetime import datetime
...
@@ -5,6 +5,7 @@ from datetime import datetime
from
flask_babel
import
lazy_gettext
as
_
from
flask_babel
import
lazy_gettext
as
_
import
flask_sqlalchemy
import
flask_sqlalchemy
import
flask_babel
import
sqlalchemy
import
sqlalchemy
import
json
import
json
import
uuid
import
uuid
...
@@ -240,6 +241,10 @@ class Profile(db.Model):
...
@@ -240,6 +241,10 @@ class Profile(db.Model):
and
(
is_admin
or
not
transition
[
3
])
and
(
is_admin
or
not
transition
[
3
])
}
}
def
transition_delta
(
self
,
formatted
=
False
):
delta
=
datetime
.
now
()
-
self
.
updated_at
return
flask_babel
.
format_timedelta
(
delta
)
if
formatted
else
delta
def
set_transition
(
self
,
transition
,
actor
):
def
set_transition
(
self
,
transition
,
actor
):
"""
Prepare the profile for transition
"""
Prepare the profile for transition
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment