Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Metagenomics
metagenedb
Commits
e2f7adf6
Commit
e2f7adf6
authored
Aug 22, 2019
by
Kenzo-Hugo Hillion
♻
Browse files
Temporary remove permission for create gene
parent
1ae71133
Changes
2
Hide whitespace changes
Inline
Side-by-side
backend/metagenedb/api/catalog/views/gene.py
View file @
e2f7adf6
...
...
@@ -48,8 +48,6 @@ class GeneViewSet(ModelViewSet):
GENE_LENGTH_COL
=
'length'
def
get_permissions
(
self
):
if
self
.
action
==
'create'
:
self
.
permission_classes
=
[
IsAdminUser
,
]
return
super
(
self
.
__class__
,
self
).
get_permissions
()
def
_count_windows
(
self
,
df
,
window_size
=
10000
,
window_col
=
GENE_LENGTH_COL
):
...
...
backend/metagenedb/settings/django.py
View file @
e2f7adf6
import
environ
import
datetime
root
=
environ
.
Path
(
__file__
)
-
3
# get root of the project
env
=
environ
.
Env
()
...
...
@@ -103,13 +103,19 @@ REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES'
:
(
'rest_framework_jwt.authentication.JSONWebTokenAuthentication'
,
'rest_framework.authentication.SessionAuthentication'
,
# 'rest_framework.authentication.BasicAuthentication',
),
'DEFAULT_PAGINATION_CLASS'
:
'rest_framework.pagination.PageNumberPagination'
,
'PAGE_SIZE'
:
100
,
}
# JWT Authorization settings
JWT_AUTH
=
{
'JWT_EXPIRATION_DELTA'
:
datetime
.
timedelta
(
seconds
=
3600
)
}
# Config by .env file
DEBUG
=
env
.
bool
(
'DEBUG'
,
default
=
False
)
...
...
Write
Preview
Supports
Markdown
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