Fakultas Ilmu Komputer UI

Commit 39bf443f authored by Kemas Khaidar Ali's avatar Kemas Khaidar Ali
Browse files

All bugs fixed

parent f7d6ead8
Pipeline #26466 failed with stages
in 5 minutes and 6 seconds
......@@ -42,6 +42,7 @@ export default class CreateVacancy extends React.Component {
requirements: '',
salary: 0,
tag: '',
responsibilities: '',
};
if (this.state.vacancyId) {
......@@ -99,6 +100,7 @@ export default class CreateVacancy extends React.Component {
const data = {};
data.name = this.state.name;
data.tag = this.state.tag;
data.responsibilities = this.state.responsibilities;
data.description = this.state.description;
data.benefits = this.state.benefits;
data.requirements = this.state.requirements;
......
......@@ -6,7 +6,7 @@ export default class Footer extends React.Component {
return (
<div className="footer">
<Container textAlign="center">
<h5>All Rights Reserved © 2017</h5>
<h5>All Rights Reserved © 2019</h5>
</Container>
</div>
);
......
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-11-16 08:50
# 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
......@@ -13,6 +14,11 @@ class Migration(migrations.Migration):
]
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',
......
......@@ -38,7 +38,7 @@ class VacancySerializer(serializers.ModelSerializer):
model = Vacancy
fields = ['company', 'verified', 'open_time', 'description', 'close_time', 'created', 'apply_before', 'updated',
'name', 'status', 'bookmarked', 'id', 'salary', 'responsibilities', 'requirements', 'working_period',
'benefits', 'max_accepted_applicants', 'total_accepted_applicants']
'benefits', 'max_accepted_applicants', 'total_accepted_applicants', 'tag']
def name_position_validator(names):
......
......@@ -142,19 +142,17 @@ class VacancyViewSet(MultiSerializerViewSetMixin, viewsets.ModelViewSet):
"open_time": raw_data['open_time'],
"close_time": raw_data['close_time'],
"name": raw_data['name'],
"salary": int(raw_data.get('salary', 0)),
"salary": raw_data.get('salary', 0),
"tag": raw_data.get('tag', ''),
"requirements": raw_data.get('requirements', ''),
"responsibilities": raw_data.get('responsibilities', ''),
"benefits": raw_data.get('benefits', ''),
"amount": raw_data.get('amount', 0),
"recruiter_activity": raw_data.get('recruiter_activity', ''),
"description": raw_data['description'],
"working_period": raw_data['working_period'],
"max_accepted_applicants": raw_data['max_accepted_applicants']
}
if 'benefits' in raw_data:
data['benefits'] = raw_data['benefits']
if 'amount' in raw_data:
data['amount'] = raw_data['amount']
if 'responsibilities' in raw_data:
data['responsibilities'] = raw_data['responsibilities']
if 'recruiter_activity' in raw_data:
data['recruiter_activity'] = raw_data['recruiter_activity']
return data
def __validate_vacancy_data(self, data):
......@@ -173,7 +171,6 @@ class VacancyViewSet(MultiSerializerViewSetMixin, viewsets.ModelViewSet):
try:
data = self.__parse_vacancy_data(request.data)
data['company'] = self.__get_company(request.data['company'])
data['tag'] = request.data.get('tag', '')
self.__validate_vacancy_data(data)
vacancy = Vacancy(**data)
vacancy.save()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment