Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
csentry
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Harrisson
csentry
Commits
873a90e8
Commit
873a90e8
authored
5 years ago
by
Benjamin Bertrand
Browse files
Options
Downloads
Patches
Plain Diff
Fix flake8 warnings
New warnings after updating flake8 version used by pre-commit-hooks
parent
b3bc18b3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/api/inventory.py
+4
-4
4 additions, 4 deletions
app/api/inventory.py
app/inventory/views.py
+1
-1
1 addition, 1 deletion
app/inventory/views.py
with
5 additions
and
5 deletions
app/api/inventory.py
+
4
−
4
View file @
873a90e8
...
@@ -45,7 +45,7 @@ def get_items():
...
@@ -45,7 +45,7 @@ def get_items():
@bp.route
(
"
/items/<id_>
"
)
@bp.route
(
"
/items/<id_>
"
)
@login_required
@login_required
def
get_item
(
id_
):
def
get_item
(
id_
):
"""
Retrieve item by id or ICS id
r
"""
Retrieve item by id or ICS id
.. :quickref: Inventory; Get item by id or ICS id
.. :quickref: Inventory; Get item by id or ICS id
...
@@ -83,7 +83,7 @@ def create_item():
...
@@ -83,7 +83,7 @@ def create_item():
@bp.route
(
"
/items/<id_>
"
,
methods
=
[
"
PATCH
"
])
@bp.route
(
"
/items/<id_>
"
,
methods
=
[
"
PATCH
"
])
@login_groups_accepted
(
"
admin
"
,
"
inventory
"
)
@login_groups_accepted
(
"
admin
"
,
"
inventory
"
)
def
patch_item
(
id_
):
def
patch_item
(
id_
):
"""
Patch an existing item
r
"""
Patch an existing item
.. :quickref: Inventory; Update existing item
.. :quickref: Inventory; Update existing item
...
@@ -143,7 +143,7 @@ def patch_item(id_):
...
@@ -143,7 +143,7 @@ def patch_item(id_):
@bp.route
(
"
/items/<id_>/comments
"
)
@bp.route
(
"
/items/<id_>/comments
"
)
@login_required
@login_required
def
get_item_comments
(
id_
):
def
get_item_comments
(
id_
):
"""
Get item comments
r
"""
Get item comments
.. :quickref: Inventory; Get item comments
.. :quickref: Inventory; Get item comments
...
@@ -156,7 +156,7 @@ def get_item_comments(id_):
...
@@ -156,7 +156,7 @@ def get_item_comments(id_):
@bp.route
(
"
/items/<id_>/comments
"
,
methods
=
[
"
POST
"
])
@bp.route
(
"
/items/<id_>/comments
"
,
methods
=
[
"
POST
"
])
@login_groups_accepted
(
"
admin
"
,
"
inventory
"
)
@login_groups_accepted
(
"
admin
"
,
"
inventory
"
)
def
create_item_comment
(
id_
):
def
create_item_comment
(
id_
):
"""
Create a comment on item
r
"""
Create a comment on item
.. :quickref: Inventory; Create comment on item
.. :quickref: Inventory; Create comment on item
...
...
This diff is collapsed.
Click to expand it.
app/inventory/views.py
+
1
−
1
View file @
873a90e8
...
@@ -234,7 +234,7 @@ def attributes(kind):
...
@@ -234,7 +234,7 @@ def attributes(kind):
db
.
session
.
add
(
new_model
)
db
.
session
.
add
(
new_model
)
try
:
try
:
db
.
session
.
commit
()
db
.
session
.
commit
()
except
sa
.
exc
.
IntegrityError
as
e
:
except
sa
.
exc
.
IntegrityError
:
db
.
session
.
rollback
()
db
.
session
.
rollback
()
flash
(
f
"
{
form
.
name
.
data
}
already exists!
{
kind
}
not created.
"
,
"
error
"
)
flash
(
f
"
{
form
.
name
.
data
}
already exists!
{
kind
}
not created.
"
,
"
error
"
)
else
:
else
:
...
...
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