Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
oser-backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hamza Touizrat
oser-backend
Commits
a6e8836e
Commit
a6e8836e
authored
Dec 18, 2017
by
florimondmanca
Browse files
Options
Downloads
Patches
Plain Diff
fix rest_framework urls, other quick fixes
parent
97606db0
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
oser_cs/api/urls.py
+1
-5
1 addition, 5 deletions
oser_cs/api/urls.py
oser_cs/oser_cs/urls.py
+2
-0
2 additions, 0 deletions
oser_cs/oser_cs/urls.py
oser_cs/users/signals.py
+3
-4
3 additions, 4 deletions
oser_cs/users/signals.py
oser_cs/utils.py
+3
-3
3 additions, 3 deletions
oser_cs/utils.py
with
9 additions
and
12 deletions
oser_cs/api/urls.py
+
1
−
5
View file @
a6e8836e
"""
API routers.
"""
"""
API routers.
"""
from
django.urls
import
path
,
include
from
rest_framework
import
routers
from
rest_framework
import
routers
from
.views
import
users
,
tutoring
from
.views
import
users
,
tutoring
app_name
=
'
api
'
app_name
=
'
api
'
urlpatterns
=
[
urlpatterns
=
[]
path
(
'
api-auth/
'
,
include
(
'
rest_framework.urls
'
,
namespace
=
'
rest_framework
'
)),
]
# Create your routes here
# Create your routes here
...
...
This diff is collapsed.
Click to expand it.
oser_cs/oser_cs/urls.py
+
2
−
0
View file @
a6e8836e
...
@@ -24,5 +24,7 @@ urlpatterns = [
...
@@ -24,5 +24,7 @@ urlpatterns = [
url
(
r
'
^admin/
'
,
admin
.
site
.
urls
),
url
(
r
'
^admin/
'
,
admin
.
site
.
urls
),
url
(
r
'
^api/
'
,
include
(
'
api.urls
'
)),
url
(
r
'
^api/
'
,
include
(
'
api.urls
'
)),
url
(
r
'
^api/docs/
'
,
include_docs_urls
(
title
=
'
OSER_CS API
'
)),
url
(
r
'
^api/docs/
'
,
include_docs_urls
(
title
=
'
OSER_CS API
'
)),
url
(
'
api-auth/
'
,
include
(
'
rest_framework.urls
'
,
namespace
=
'
rest_framework
'
)),
url
(
r
'
^$
'
,
TemplateView
.
as_view
(
template_name
=
'
index.html
'
)),
url
(
r
'
^$
'
,
TemplateView
.
as_view
(
template_name
=
'
index.html
'
)),
]
]
This diff is collapsed.
Click to expand it.
oser_cs/users/signals.py
+
3
−
4
View file @
a6e8836e
...
@@ -9,7 +9,6 @@ from .models import User, Profile
...
@@ -9,7 +9,6 @@ from .models import User, Profile
@receiver
(
post_save
,
sender
=
User
)
@receiver
(
post_save
,
sender
=
User
)
def
create_profile_for_new_user
(
sender
,
created
,
instance
,
**
kwargs
):
def
create_profile_for_new_user
(
sender
,
created
,
instance
,
**
kwargs
):
"""
Automatically creates a new profile for a newly created user.
"""
"""
Automatically creates a new profile for a newly created user.
"""
if
created
:
if
created
and
instance
.
profile_type
:
if
instance
.
profile_type
:
model
=
Profile
.
get_model
(
instance
.
profile_type
)
model
=
Profile
.
get_model
(
instance
.
profile_type
)
model
.
objects
.
create
(
user
=
instance
)
model
.
objects
.
create
(
user
=
instance
)
This diff is collapsed.
Click to expand it.
oser_cs/utils.py
+
3
−
3
View file @
a6e8836e
...
@@ -2,10 +2,10 @@
...
@@ -2,10 +2,10 @@
def
modify_fields
(
**
kwargs
):
def
modify_fields
(
**
kwargs
):
"""
Modify the fields of a
superclass
.
"""
Modify the fields of a
n inherited model
.
Caution: will affect the
superclass
'
fields too. It is preferable to
Caution: will affect the
inherited model
'
s
fields too. It is preferable to
restrict the usage to cases when the
superclass
is abstract.
restrict the usage to cases when the
inherited model
is abstract.
Example
Example
-------
-------
...
...
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