Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add weekly working hours field for users #1495

Merged
merged 3 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions care/users/api/serializers/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ class Meta:
"doctor_medical_council_registration",
"created_by",
"home_facility",
"weekly_working_hours",
"local_body",
"district",
"state",
Expand Down Expand Up @@ -398,6 +399,7 @@ class Meta:
"doctor_qualification",
"doctor_experience_commenced_on",
"doctor_medical_council_registration",
"weekly_working_hours",
"created_by",
"last_login",
"home_facility_object",
Expand Down
24 changes: 24 additions & 0 deletions care/users/migrations/0006_user_weekly_working_hours.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 4.2.2 on 2023-08-01 19:32

import django.core.validators
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("users", "0005_alter_user_alt_phone_number_alter_user_phone_number"),
]

operations = [
migrations.AddField(
model_name="user",
name="weekly_working_hours",
field=models.IntegerField(
default=168,
validators=[
django.core.validators.MinValueValidator(0),
django.core.validators.MaxValueValidator(168),
],
),
),
]
3 changes: 3 additions & 0 deletions care/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ class User(AbstractUser):
home_facility = models.ForeignKey(
"facility.Facility", on_delete=models.PROTECT, null=True, blank=True
)
weekly_working_hours = models.IntegerField(
default=168, validators=[MinValueValidator(0), MaxValueValidator(168)]
)

doctor_qualification = models.TextField(
blank=False,
Expand Down
Loading