Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Class Project
Kape
Commits
62a0b0b4
Commit
62a0b0b4
authored
Dec 03, 2019
by
Muhammad Fauzan Fikri
Browse files
Merge branch '1506688802-173' into 'master'
1506688802 173 See merge request
!215
parents
42c6d382
cdfa1270
Pipeline
#26549
passed with stages
in 16 minutes and 34 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
assets/js/EditProfile.jsx
View file @
62a0b0b4
...
...
@@ -64,6 +64,7 @@ export default class EditProfile extends React.Component {
linkedin_url
:
''
,
hackerrank_url
:
''
,
student_gpa
:
0.0
,
student_toefl
:
0
,
website_url
:
''
,
latest_work
:
''
,
latest_work_desc
:
''
,
...
...
@@ -104,6 +105,7 @@ export default class EditProfile extends React.Component {
linkedin_url
:
data
.
linkedin_url
,
hackerrank_url
:
data
.
hackerrank_url
,
student_gpa
:
data
.
student_gpa
,
student_toefl
:
data
.
student_toefl
,
website_url
:
data
.
website_url
,
latest_work
:
data
.
latest_work
,
latest_work_desc
:
data
.
latest_work_desc
,
...
...
@@ -617,6 +619,25 @@ export default class EditProfile extends React.Component {
name
=
"student_gpa"
/>
</
Form
.
Field
>
<
Form
.
Field
>
<
label
htmlFor
=
"student_toefl"
>
TOEFL
</
label
>
<
input
onChange
=
{
this
.
handleChange
}
placeholder
=
{
this
.
state
.
student_toefl
===
null
?
'
400
'
:
this
.
state
.
student_toefl
}
defaultValue
=
{
this
.
state
.
student_toefl
===
null
?
null
:
this
.
state
.
student_toefl
}
name
=
"student_toefl"
/>
</
Form
.
Field
>
<
Form
.
Field
>
<
label
htmlFor
=
"dependants"
>
Dependants
</
label
>
<
input
...
...
assets/js/ProfilePage.jsx
View file @
62a0b0b4
...
...
@@ -86,6 +86,7 @@ export default class ProfilePage extends React.Component {
hackerrank_url
:
''
,
self_description
:
''
,
student_gpa
:
0.0
,
student_toefl
:
0
,
website_url
:
''
,
latest_work
:
''
,
latest_work_desc
:
''
,
...
...
@@ -150,6 +151,7 @@ export default class ProfilePage extends React.Component {
hackerrank_url
:
data
.
hackerrank_url
,
self_description
:
data
.
self_description
,
student_gpa
:
data
.
student_gpa
,
student_toefl
:
data
.
student_toefl
,
website_url
:
data
.
website_url
,
latest_work
:
data
.
latest_work
,
alamat
:
data
.
alamat
,
...
...
@@ -694,6 +696,23 @@ export default class ProfilePage extends React.Component {
name
=
"student_gpa"
/>
</
Form
.
Field
>
<
Form
.
Field
>
<
label
htmlFor
=
"student_toefl"
>
TOEFL
</
label
>
<
input
onChange
=
{
this
.
handleChange
}
placeholder
=
{
this
.
state
.
student_toefl
===
null
?
'
400
'
:
this
.
state
.
student_toefl
}
defaultValue
=
{
this
.
state
.
student_toefl
===
null
?
null
:
this
.
state
.
student_toefl
}
name
=
"student_toefl"
/>
</
Form
.
Field
>
<
Form
.
Field
>
<
label
htmlFor
=
"dependants"
>
Dependants
</
label
>
<
input
...
...
@@ -910,6 +929,21 @@ export default class ProfilePage extends React.Component {
</
Grid
>
</
Segment
>
<
Segment
basic
vertical
>
<
Grid
>
<
Grid
.
Column
width
=
{
2
}
>
<
Icon
name
=
"pencil alternate"
size
=
"big"
/>
</
Grid
.
Column
>
<
Grid
.
Column
width
=
{
13
}
>
<
p
href
=
{
this
.
state
.
student_toefl
}
>
{
'
'
}
{
this
.
state
.
student_toefl
||
'
N/A
'
}
{
'
'
}
</
p
>
</
Grid
.
Column
>
</
Grid
>
</
Segment
>
<
Segment
basic
vertical
>
<
Grid
>
<
Grid
.
Column
width
=
{
2
}
>
...
...
core/migrations/0001_initial.py
View file @
62a0b0b4
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-1
1-16 08:22
# Generated by Django 1.11.17 on 2019-1
2-03 03:38
from
__future__
import
unicode_literals
import
core.lib.validators
...
...
@@ -34,12 +34,12 @@ class Migration(migrations.Migration):
(
'created'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'updated'
,
models
.
DateTimeField
(
auto_now
=
True
)),
(
'description'
,
models
.
TextField
()),
(
'status'
,
models
.
IntegerField
(
default
=
0
)),
(
'status'
,
models
.
IntegerField
(
default
=
0
,
validators
=
[
django
.
core
.
validators
.
MaxValueValidator
(
2
),
django
.
core
.
validators
.
MinValueValidator
(
0
)]
)),
(
'logo'
,
models
.
FileField
(
blank
=
True
,
null
=
True
,
upload_to
=
core
.
models
.
accounts
.
get_company_logo_file_path
,
validators
=
[
core
.
lib
.
validators
.
validate_image_file_extension
])),
(
'address'
,
models
.
CharField
(
blank
=
True
,
max_length
=
1000
,
null
=
True
)),
(
'category'
,
models
.
CharField
(
default
=
b
'Belum ada kategori perusahaan'
,
max_length
=
140
)),
(
'category'
,
models
.
CharField
(
default
=
'Belum ada kategori perusahaan'
,
max_length
=
140
)),
(
'size'
,
models
.
CharField
(
blank
=
True
,
default
=
0
,
max_length
=
10
,
null
=
True
)),
(
'website'
,
models
.
CharField
(
default
=
b
'Belum ada link website'
,
max_length
=
100
)),
(
'website'
,
models
.
CharField
(
default
=
'Belum ada link website'
,
max_length
=
100
)),
(
'linkedin_url'
,
models
.
URLField
(
blank
=
True
,
null
=
True
)),
(
'user'
,
models
.
OneToOneField
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
settings
.
AUTH_USER_MODEL
)),
],
...
...
@@ -52,7 +52,7 @@ class Migration(migrations.Migration):
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'created'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'title'
,
models
.
CharField
(
blank
=
True
,
default
=
b
''
,
max_length
=
100
)),
(
'title'
,
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
100
)),
(
'content'
,
models
.
TextField
()),
(
'companyId'
,
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'core.Company'
)),
],
...
...
@@ -64,7 +64,7 @@ class Migration(migrations.Migration):
name
=
'Recommendation'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'content'
,
models
.
TextField
()),
(
'content'
,
models
.
TextField
(
blank
=
True
)),
(
'created'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'updated'
,
models
.
DateTimeField
(
auto_now
=
True
)),
],
...
...
@@ -79,16 +79,16 @@ class Migration(migrations.Migration):
(
'created'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'updated'
,
models
.
DateTimeField
(
auto_now
=
True
)),
(
'npm'
,
models
.
IntegerField
(
unique
=
True
,
validators
=
[
core
.
lib
.
validators
.
validate_npm
])),
(
'resume'
,
models
.
FileField
(
blank
=
True
,
null
=
True
,
upload_to
=
core
.
models
.
accounts
.
get_student_resume_file_path
,
validators
=
[
django
.
core
.
validators
.
FileExtensionValidator
([
b
'pdf'
])])),
(
'resume'
,
models
.
FileField
(
blank
=
True
,
null
=
True
,
upload_to
=
core
.
models
.
accounts
.
get_student_resume_file_path
,
validators
=
[
django
.
core
.
validators
.
FileExtensionValidator
([
'pdf'
])])),
(
'sertifikat'
,
models
.
FileField
(
blank
=
True
,
null
=
True
,
upload_to
=
core
.
models
.
accounts
.
get_student_sertifikat_file_path
,
validators
=
[
core
.
lib
.
validators
.
validate_document_file_extension
])),
(
'phone_number'
,
models
.
CharField
(
blank
=
True
,
db_index
=
True
,
max_length
=
100
,
null
=
True
,
validators
=
[
django
.
core
.
validators
.
RegexValidator
(
b
'^0
\\
d{1,11}$'
)])),
(
'phone_number'
,
models
.
CharField
(
blank
=
True
,
db_index
=
True
,
max_length
=
100
,
null
=
True
,
validators
=
[
django
.
core
.
validators
.
RegexValidator
(
'^0
\\
d{1,11}$'
)])),
(
'gender'
,
models
.
CharField
(
blank
=
True
,
max_length
=
30
,
null
=
True
)),
(
'birth_place'
,
models
.
CharField
(
blank
=
True
,
max_length
=
30
,
null
=
True
)),
(
'birth_date'
,
models
.
DateField
(
blank
=
True
,
null
=
True
)),
(
'major'
,
models
.
CharField
(
blank
=
True
,
max_length
=
30
,
null
=
True
)),
(
'batch'
,
models
.
CharField
(
blank
=
True
,
max_length
=
4
,
null
=
True
)),
(
'show_transcript'
,
models
.
BooleanField
(
default
=
False
)),
(
'photo'
,
models
.
FileField
(
blank
=
True
,
null
=
True
,
upload_to
=
core
.
models
.
accounts
.
get_student_photo_file_path
,
validators
=
[
django
.
core
.
validators
.
FileExtensionValidator
([
b
'jpg'
,
b
'jpeg'
,
b
'png'
])])),
(
'photo'
,
models
.
FileField
(
blank
=
True
,
null
=
True
,
upload_to
=
core
.
models
.
accounts
.
get_student_photo_file_path
,
validators
=
[
django
.
core
.
validators
.
FileExtensionValidator
([
'jpg'
,
'jpeg'
,
'png'
])])),
(
'self_description'
,
models
.
CharField
(
blank
=
True
,
db_index
=
True
,
max_length
=
500
,
null
=
True
)),
(
'portfolio_link'
,
models
.
URLField
(
blank
=
True
,
null
=
True
)),
(
'linkedin_url'
,
models
.
URLField
(
blank
=
True
,
null
=
True
)),
...
...
@@ -104,9 +104,10 @@ class Migration(migrations.Migration):
(
'github_url'
,
models
.
URLField
(
blank
=
True
,
null
=
True
)),
(
'gitlab_url'
,
models
.
URLField
(
blank
=
True
,
null
=
True
)),
(
'intro'
,
models
.
CharField
(
blank
=
True
,
max_length
=
50
,
null
=
True
)),
(
'expected_salary'
,
models
.
CharField
(
blank
=
True
,
max_length
=
10
,
null
=
True
,
validators
=
[
django
.
core
.
validators
.
RegexValidator
(
b
'^
\\
d{0,10}$'
)])),
(
'expected_salary'
,
models
.
CharField
(
blank
=
True
,
max_length
=
10
,
null
=
True
,
validators
=
[
django
.
core
.
validators
.
RegexValidator
(
'^
\\
d{0,10}$'
)])),
(
'job_seeking_status'
,
models
.
CharField
(
blank
=
True
,
max_length
=
30
,
null
=
True
)),
(
'student_gpa'
,
models
.
FloatField
(
blank
=
True
,
db_column
=
b
'student_gpa'
,
default
=
1.0
,
null
=
True
,
validators
=
[
core
.
lib
.
validators
.
validate_student_gpa
])),
(
'student_gpa'
,
models
.
FloatField
(
blank
=
True
,
db_column
=
'student_gpa'
,
default
=
1.0
,
null
=
True
,
validators
=
[
core
.
lib
.
validators
.
validate_student_gpa
])),
(
'student_toefl'
,
models
.
CharField
(
blank
=
True
,
max_length
=
3
,
null
=
True
)),
(
'volunteer'
,
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
)),
(
'awards'
,
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
)),
(
'projects'
,
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
)),
...
...
@@ -114,7 +115,7 @@ class Migration(migrations.Migration):
(
'languages'
,
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
)),
(
'seminar'
,
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
)),
(
'interests'
,
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
)),
(
'dependants'
,
models
.
IntegerField
(
blank
=
True
,
db_column
=
b
'dependants'
,
default
=
0
,
null
=
True
)),
(
'dependants'
,
models
.
IntegerField
(
blank
=
True
,
db_column
=
'dependants'
,
default
=
0
,
null
=
True
)),
],
options
=
{
'ordering'
:
[
'-updated'
],
...
...
@@ -174,7 +175,7 @@ class Migration(migrations.Migration):
name
=
'ReasonRejected'
,
fields
=
[
(
'application'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
primary_key
=
True
,
serialize
=
False
,
to
=
'core.Application'
)),
(
'reason'
,
models
.
TextField
(
default
=
b
'Tidak memenuhi kualifikasi perusahaan.'
)),
(
'reason'
,
models
.
TextField
(
default
=
'Tidak memenuhi kualifikasi perusahaan.'
)),
],
),
migrations
.
AddField
(
...
...
@@ -200,12 +201,12 @@ class Migration(migrations.Migration):
migrations
.
AddField
(
model_name
=
'recommendation'
,
name
=
'recommendation_giver'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
related_name
=
'giver'
,
to
=
'core.Student'
),
field
=
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
related_name
=
'giver'
,
to
=
'core.Student'
),
),
migrations
.
AddField
(
model_name
=
'recommendation'
,
name
=
'recommendation_receiver'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
related_name
=
'receiver'
,
to
=
'core.Student'
),
field
=
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
related_name
=
'receiver'
,
to
=
'core.Student'
),
),
migrations
.
AddField
(
model_name
=
'feedback'
,
...
...
core/migrations/0002_auto_20191116_1550.py
deleted
100644 → 0
View file @
42c6d382
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-12-01 10:01
from
__future__
import
unicode_literals
import
django.core.validators
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'core'
,
'0001_initial'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'company'
,
name
=
'status'
,
field
=
models
.
IntegerField
(
default
=
0
,
validators
=
[
django
.
core
.
validators
.
MaxValueValidator
(
2
),
django
.
core
.
validators
.
MinValueValidator
(
0
)]),
),
migrations
.
AlterField
(
model_name
=
'recommendation'
,
name
=
'content'
,
field
=
models
.
TextField
(
blank
=
True
),
),
migrations
.
AlterField
(
model_name
=
'recommendation'
,
name
=
'recommendation_giver'
,
field
=
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
related_name
=
'giver'
,
to
=
'core.Student'
),
),
migrations
.
AlterField
(
model_name
=
'recommendation'
,
name
=
'recommendation_receiver'
,
field
=
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
related_name
=
'receiver'
,
to
=
'core.Student'
),
),
]
core/migrations/0002_auto_20191203_1051.py
0 → 100644
View file @
62a0b0b4
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-12-03 03:51
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'core'
,
'0001_initial'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'student'
,
name
=
'student_toefl'
,
field
=
models
.
IntegerField
(
blank
=
True
,
db_column
=
'toefl'
,
default
=
0
,
null
=
True
),
),
]
core/models/accounts.py
View file @
62a0b0b4
...
...
@@ -111,6 +111,7 @@ class Student(models.Model):
job_seeking_status
=
models
.
CharField
(
max_length
=
30
,
blank
=
True
,
null
=
True
)
student_gpa
=
models
.
FloatField
(
db_column
=
'student_gpa'
,
default
=
1.0
,
blank
=
True
,
null
=
True
,
validators
=
[
validate_student_gpa
])
student_toefl
=
models
.
IntegerField
(
db_column
=
'toefl'
,
default
=
0
,
blank
=
True
,
null
=
True
)
volunteer
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
,
null
=
True
)
awards
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
,
null
=
True
)
projects
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
,
null
=
True
)
...
...
core/serializers/accounts.py
View file @
62a0b0b4
...
...
@@ -26,7 +26,7 @@ class StudentSerializer(serializers.ModelSerializer):
'work_experience'
,
'latest_work'
,
'latest_work_desc'
,
'read_no'
,
'volunteer'
,
'job_seeking_status'
,
'skills'
,
'expected_salary'
,
'self_description'
,
'github_url'
,
'gitlab_url'
,
'awards'
,
'certification'
,
'languages'
,
'seminar'
,
'interests'
,
'alamat'
,
'projects'
,
'dependants'
]
'interests'
,
'alamat'
,
'projects'
,
'dependants'
,
'student_toefl'
]
@
staticmethod
def
get_accepted_no
(
obj
):
...
...
@@ -66,6 +66,7 @@ class StudentUpdateSerializer(serializers.ModelSerializer):
'job_seeking_status'
:
instance
.
job_seeking_status
,
'website_url'
:
instance
.
website_url
,
'student_gpa'
:
instance
.
student_gpa
,
'student_toefl'
:
instance
.
student_toefl
,
'volunteer'
:
instance
.
volunteer
,
'linkedin_url'
:
instance
.
linkedin_url
,
'hackerrank_url'
:
instance
.
hackerrank_url
,
...
...
@@ -118,6 +119,7 @@ class StudentUpdateSerializer(serializers.ModelSerializer):
'job_seeking_status'
,
instance
.
job_seeking_status
)
instance
.
student_gpa
=
validated_data
.
get
(
'student_gpa'
,
instance
.
student_gpa
)
instance
.
student_toefl
=
validated_data
.
get
(
'student_toefl'
,
instance
.
student_toefl
)
instance
.
website_url
=
validated_data
.
get
(
'website_url'
,
instance
.
website_url
)
instance
.
skills
=
validated_data
.
get
(
'skills'
,
instance
.
skills
)
...
...
@@ -155,7 +157,7 @@ class StudentUpdateSerializer(serializers.ModelSerializer):
'work_experience'
,
'latest_work'
,
'latest_work_desc'
,
'volunteer'
,
'job_seeking_status'
,
'skills'
,
'expected_salary'
,
'self_description'
,
'github_url'
,
'gitlab_url'
,
'awards'
,
'certification'
,
'languages'
,
'seminar'
,
'interests'
,
'alamat'
,
'projects'
,
'dependants'
]
'interests'
,
'alamat'
,
'projects'
,
'dependants'
,
'student_toefl'
]
class
CompanyUpdateSerializer
(
serializers
.
ModelSerializer
):
...
...
core/tests/test_accounts.py
View file @
62a0b0b4
...
...
@@ -394,6 +394,15 @@ class ProfileUpdateTests(APITestCase):
response
=
self
.
client
.
patch
(
url
,
{
'GPA'
:
"this is not a valid input"
},
format
=
'multipart'
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_202_ACCEPTED
)
url
=
'/api/students/'
+
str
(
student_id
)
+
"/profile/"
response
=
self
.
client
.
patch
(
url
,
{
'TOEFL'
:
0
},
format
=
'multipart'
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_202_ACCEPTED
)
self
.
assertEqual
(
response
.
data
.
get
(
'student_toefl'
),
0
)
url
=
'/api/students/'
+
str
(
student_id
)
+
"/profile/"
response
=
self
.
client
.
patch
(
url
,
{
'student_toefl'
:
'this is not valid input'
},
format
=
'multipart'
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_400_BAD_REQUEST
)
url
=
'/api/students/'
+
str
(
student_id
)
+
'/profile/'
response
=
self
.
client
.
patch
(
url
,
{
'volunteer'
:
'Ketua BEM UI - 2020'
},
format
=
'multipart'
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_202_ACCEPTED
)
...
...
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