Skip to content

Commit

Permalink
Change timezone.now to timezone.localtime
Browse files Browse the repository at this point in the history
  • Loading branch information
yukitya-1811 committed Jun 19, 2024
1 parent 1648a51 commit 6748a71
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion corpus/accounts/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Migration(migrations.Migration):
(
"date_joined",
models.DateTimeField(
default=django.utils.timezone.now, verbose_name="date joined"
default=django.utils.timezone.localtime, verbose_name="date joined"
),
),
("phone_no", models.CharField(max_length=13, unique=True)),
Expand Down
2 changes: 1 addition & 1 deletion corpus/accounts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class ExecutiveMember(models.Model):
)
is_nep = models.BooleanField(default=False, verbose_name="Is NEP Member?")
date_joined = models.DateTimeField(
default=timezone.now(), verbose_name="Date Joined"
default=timezone.localtime(), verbose_name="Date Joined"
)

def save(self, *args, **kwargs):
Expand Down
4 changes: 2 additions & 2 deletions corpus/virtual_expo/member_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def new_report(request):
form = ReportForm(request.POST, request.FILES)
if form.is_valid():
report = form.save(commit=False)
report.created_at = timezone.now()
report.created_at = timezone.localtime()
report.save()

ReportMember.objects.create(report=report, member=request.exec_member)
Expand Down Expand Up @@ -148,7 +148,7 @@ def approver_dashboard(request):
report = Report.objects.get(pk=report_id)
if report.approver == request.exec_member:
report.approved = True
report.approved_at = timezone.now()
report.approved_at = timezone.localtime()
report.save()
messages.success(request, "Report marked as approved!")
return redirect("virtual_expo_members_approver_dashboard")
Expand Down

0 comments on commit 6748a71

Please sign in to comment.