Skip to content

Commit

Permalink
Added office as a dummy data
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahmoud-Emad committed Oct 30, 2023
1 parent e2f5376 commit 6b3edc6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
16 changes: 8 additions & 8 deletions client/src/componants/register/Register.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
validatePhoneNumber,
validatePassword,
validateTelegramLink,
validateSalary,
// validateSalary,
validateBirthday
} from '../../utils/validations';
import MultiSelect from '../ui/select/MultiSelect.svelte';
Expand All @@ -33,15 +33,15 @@
isErrorJobTitle: null | boolean,
isErrorpass: null | boolean,
isErrorLink: null | boolean,
isErrorBenefits: null | boolean,
// isErrorBenefits: null | boolean,
isErrorBirthday: null | boolean,
isErrorLocation: null | boolean,
isErrorSuperuser: null | boolean,
isErrorCurrentNetSalary: null | boolean,
isErrorCurrentGrossSalary: null | boolean,
isErrorNetJoinningSalary: null | boolean,
isErrorGrossJoinningSalary: null | boolean,
isErrorNetBeforeJoinningSalary: null | boolean,
// isErrorNetJoinningSalary: null | boolean,
// isErrorGrossJoinningSalary: null | boolean,
// isErrorNetBeforeJoinningSalary: null | boolean,
isErrorUserType: null | boolean,
isErrorSocialNumber: null | boolean,
isErrorAddress: null | boolean
Expand All @@ -65,9 +65,9 @@
let locationSelected: SelectOptionType[] = [];
let reportingToSelected: SelectOptionType[] = [];
let salaryField = [false,false,false,false]
let showaddbutton = true;
let thisSalaryInput: number = 0;
// let salaryField = [false,false,false,false]
// let showaddbutton = true;
// let thisSalaryInput: number = 0;
</script>

<div class="bg-white p-3 card">
Expand Down
6 changes: 0 additions & 6 deletions server/cshr/models/office.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,8 @@

class WEEKEND_DAYS(models.TextChoices):
"""Weekenh holidays choices"""

Friday_and_Saturday = "Friday:Saturday", "Friday:Saturday"
Saturday_and_Sunday = "Saturday:Sunday", "Saturday:Sunday"
Sunday_and_Monday = "Sunday:Monday", "Sunday:Monday"
Monday_and_Tuesday = "Monday:Tuesday", "Monday:Tuesday"
Tuesday_and_Wednesday = "Tuesday:Wednesday", "Tuesday:Wednesday"
Wednesday_and_Thursday = "Wednesday:Thursday", "Wednesday:Thursday"
Thursday_and_Friday = "Thursday:Friday", "Thursday:Friday"


class Office(TimeStamp):
Expand Down
9 changes: 5 additions & 4 deletions server/cshr/models/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from server.cshr.models.abstracts import TimeStamp
from server.cshr.models.office import Office
from server.cshr.utils.dummy_data import create_locations
from server.cshr.utils.generate import generate_random_color


Expand Down Expand Up @@ -44,13 +45,13 @@ def create_user(self, email: str, password: str) -> "User":
"""DMC method to create user"""
if not email:
raise ValueError("Users must have an email address")
office, created = Office.objects.get_or_create(
name="Codescalers", country="Egypt"
)

create_locations()

user = self.model(
email=self.normalize_email(email),
birthday=datetime.datetime.now(),
location=office,
location=Office.objects.get(id=2), # Egypt office takes id 2

Check failure on line 54 in server/cshr/models/users.py

View workflow job for this annotation

GitHub Actions / Flake8

server/cshr/models/users.py#L54

At least two spaces before inline comment (E261)
user_type=USER_TYPE.ADMIN,
first_name="Codescalers",
last_name="Admin",
Expand Down

0 comments on commit 6b3edc6

Please sign in to comment.