Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
steering
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
steering
Commits
aa69e1c4
Unverified
Commit
aa69e1c4
authored
4 years ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
Replace naive datetime with timezone aware.
Also clean-up unused imports.
parent
3e0e654a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
program/serializers.py
+8
-9
8 additions, 9 deletions
program/serializers.py
with
8 additions
and
9 deletions
program/serializers.py
+
8
−
9
View file @
aa69e1c4
# -*- coding: utf-8 -*-
from
django.contrib.auth.models
import
User
from
django.core.exceptions
import
ObjectDoesNotExist
from
django.contrib.auth.models
import
User
,
Group
from
rest_framework
import
serializers
,
status
from
rest_framework.response
import
Response
from
program.models
import
Show
,
Schedule
,
TimeSlot
,
Category
,
FundingCategory
,
Host
,
Language
,
Topic
,
MusicFocus
,
Note
,
Type
,
Language
,
RRule
from
django.utils
import
timezone
from
rest_framework
import
serializers
from
profile.models
import
Profile
from
profile.serializers
import
ProfileSerializer
from
datetime
import
datetime
from
program.models
import
Show
,
Schedule
,
TimeSlot
,
Category
,
FundingCategory
,
Host
,
Topic
,
MusicFocus
,
Note
,
Type
,
Language
,
\
RRule
from
pv.settings
import
THUMBNAIL_SIZES
class
UserSerializer
(
serializers
.
ModelSerializer
):
# Add profile fields to JSON
profile
=
ProfileSerializer
()
...
...
@@ -28,7 +27,7 @@ class UserSerializer(serializers.ModelSerializer):
profile_data
=
validated_data
.
pop
(
'
profile
'
)
user
=
super
(
UserSerializer
,
self
).
create
(
validated_data
)
user
.
date_joined
=
datetime
.
today
()
user
.
date_joined
=
timezone
.
now
()
user
.
set_password
(
validated_data
[
'
password
'
])
user
.
save
()
...
...
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