Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Class Project
Kape
Commits
0e8cadea
Commit
0e8cadea
authored
Oct 08, 2019
by
Izzan Fakhril Islam
Browse files
Merge branch 'master' into '1606875806-66'
# Conflicts: # core/models/accounts.py
parent
b6a21832
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
core/migrations/0019_auto_20191006_0906.py
0 → 100644
View file @
0e8cadea
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-10-06 02:06
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'core'
,
'0018_merge_20191006_0603'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'company'
,
name
=
'category'
,
field
=
models
.
CharField
(
default
=
'Belum ada kategori perusahaan'
,
max_length
=
140
),
),
migrations
.
AlterField
(
model_name
=
'feedback'
,
name
=
'title'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
100
),
),
]
core/migrations/0020_merge_20191006_1538.py
0 → 100644
View file @
0e8cadea
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-10-06 08:38
from
__future__
import
unicode_literals
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'core'
,
'0019_auto_20191006_0906'
),
(
'core'
,
'0017_vacancy_amount'
),
(
'core'
,
'0019_merge_20191006_0852'
),
]
operations
=
[
]
core/migrations/0021_merge_20191006_2031.py
0 → 100644
View file @
0e8cadea
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-10-06 13:31
from
__future__
import
unicode_literals
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'core'
,
'0014_auto_20191004_1340'
),
(
'core'
,
'0020_merge_20191006_1538'
),
]
operations
=
[
]
core/migrations/0022_student_recommendations.py
0 → 100644
View file @
0e8cadea
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-10-06 13:38
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'core'
,
'0021_merge_20191006_2031'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'student'
,
name
=
'recommendations'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
500
,
null
=
True
),
),
]
core/migrations/0032_merge_20191008_1655.py
0 → 100644
View file @
0e8cadea
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-10-08 09:55
from
__future__
import
unicode_literals
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'core'
,
'0029_merge_20191008_1247'
),
(
'core'
,
'0031_auto_20191008_1608'
),
(
'core'
,
'0022_student_recommendations'
),
]
operations
=
[
]
core/models/accounts.py
View file @
0e8cadea
...
...
@@ -72,6 +72,7 @@ class Student(models.Model):
photo
=
models
.
FileField
(
upload_to
=
get_student_photo_file_path
,
null
=
True
,
blank
=
True
,
validators
=
[
validate_image_file_extension
])
linkedin_url
=
models
.
URLField
(
max_length
=
200
,
blank
=
True
,
null
=
True
)
region
=
models
.
CharField
(
max_length
=
30
,
blank
=
True
,
null
=
True
)
recommendations
=
models
.
CharField
(
max_length
=
500
,
blank
=
True
,
null
=
True
)
ui_ux_portofolio
=
models
.
FileField
(
upload_to
=
get_student_ui_ux_portofolio_file_path
,
null
=
True
,
blank
=
True
,
validators
=
[
validate_document_file_extension
])
latest_work
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
,
null
=
True
)
latest_work_desc
=
models
.
TextField
(
blank
=
True
,
null
=
True
)
...
...
core/serializers/accounts.py
View file @
0e8cadea
...
...
@@ -20,7 +20,8 @@ class StudentSerializer(serializers.ModelSerializer):
class
Meta
:
model
=
Student
fields
=
[
'id'
,
'name'
,
'user'
,
'npm'
,
'resume'
,
'phone_number'
,
'birth_place'
,
'birth_date'
,
'major'
,
'batch'
,
\
'show_transcript'
,
'photo'
,
'accepted_no'
,
'linkedin_url'
,
'region'
,
'intro'
,
'latest_work'
,
'latest_work_desc'
,
'read_no'
]
'show_transcript'
,
'photo'
,
'accepted_no'
,
'linkedin_url'
,
'region'
,
'intro'
,
'recommendations'
,
'latest_work'
,
'latest_work_desc'
,
'read_no'
]
def
get_accepted_no
(
self
,
obj
):
apps
=
Application
.
objects
.
filter
(
student
=
obj
,
status
=
4
)
...
...
@@ -51,7 +52,8 @@ class StudentUpdateSerializer(serializers.ModelSerializer):
'photo'
:
photo
,
'show_transcript'
:
instance
.
show_transcript
,
'intro'
:
instance
.
intro
,
'linkedin_url'
:
instance
.
linkedin_url
,
'linkedin_url'
:
instance
.
linkedin_url
,
'recommendations'
:
instance
.
recommendations
,
'latest_work'
:
instance
.
latest_work
,
'latest_work_desc'
:
instance
.
latest_work_desc
,
}
...
...
@@ -65,6 +67,7 @@ class StudentUpdateSerializer(serializers.ModelSerializer):
instance
.
user
.
email
=
validated_data
.
get
(
'email'
,
instance
.
user
.
email
)
instance
.
intro
=
validated_data
.
get
(
'intro'
,
instance
.
intro
)
instance
.
linkedin_url
=
validated_data
.
get
(
'linkedin_url'
,
instance
.
linkedin_url
)
instance
.
recommendations
=
validated_data
.
get
(
'recommendations'
,
instance
.
recommendations
)
instance
.
latest_work
=
validated_data
.
get
(
'latest_work'
,
instance
.
latest_work
)
instance
.
latest_work_desc
=
validated_data
.
get
(
'latest_work_desc'
,
instance
.
latest_work_desc
)
instance
.
save
()
...
...
@@ -73,7 +76,8 @@ class StudentUpdateSerializer(serializers.ModelSerializer):
class
Meta
:
model
=
Student
fields
=
[
'resume'
,
'email'
,
'phone_number'
,
'photo'
,
'show_transcript'
,
'linkedin_url'
,
'region'
,
'intro'
,
'latest_work'
,
'latest_work_desc'
]
fields
=
[
'resume'
,
'email'
,
'phone_number'
,
'photo'
,
'show_transcript'
,
'linkedin_url'
,
'region'
,
'intro'
,
'recommendations'
,
'latest_work'
,
'latest_work_desc'
]
class
CompanyUpdateSerializer
(
serializers
.
ModelSerializer
):
...
...
core/tests/test_accounts.py
View file @
0e8cadea
...
...
@@ -152,6 +152,11 @@ class ProfileUpdateTests(APITestCase):
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_202_ACCEPTED
)
self
.
assertEqual
(
response
.
data
.
get
(
'linkedin_url'
),
'https://www.linkedin.com/in/jojo/'
)
url
=
'/api/students/'
+
str
(
student_id
)
+
"/profile/"
response
=
self
.
client
.
patch
(
url
,
{
'recommendations'
:
'mantap kak'
},
format
=
'multipart'
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_202_ACCEPTED
)
self
.
assertEqual
(
response
.
data
.
get
(
'recommendations'
),
'mantap kak'
)
response
=
self
.
client
.
patch
(
url
,
{
'region'
:
'Indonesia'
},
format
=
'multipart'
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_202_ACCEPTED
)
self
.
assertEqual
(
response
.
data
.
get
(
'region'
),
'Indonesia'
)
...
...
@@ -197,7 +202,7 @@ class ProfileUpdateTests(APITestCase):
response
=
self
.
client
.
patch
(
url
,
{
'latest_work_desc'
:
'Evaluate weekly assignment for 15 students'
},
format
=
'multipart'
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_202_ACCEPTED
)
self
.
assertEqual
(
response
.
data
.
get
(
'latest_work_desc'
),
'Evaluate weekly assignment for 15 students'
)
url
=
'/api/students/'
+
str
(
student_id
)
+
'/profile/'
response
=
self
.
client
.
patch
(
url
,
{
'intro'
:
'Saya tertarik dengan dunia front-end development'
},
format
=
'multipart'
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_202_ACCEPTED
)
...
...
package-lock.json
View file @
0e8cadea
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment