Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ class Meta:

created_at = TimezoneAwareDateTimeField(required=True, source="creation_time")
created_at_local = serializers.SerializerMethodField(
help_text="The date and time when the record was created, displayed in the local timezone specified for this entry."
help_text="The date and time when the record was created, displayed without timezone field."
Copy link

Copilot AI Oct 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The help text is unclear about the purpose and implications of removing timezone information. Consider: 'The date and time when the record was created, displayed in local time without timezone offset. Consumers must track timezone separately if needed.'

Suggested change
help_text="The date and time when the record was created, displayed without timezone field."
help_text="The date and time when the record was created, displayed in local time without timezone offset. Consumers must track timezone separately if needed."

Copilot uses AI. Check for mistakes.
)
sent_at = TimezoneAwareDateTimeField(required=True, source="phone_upload_time")
published = serializers.SerializerMethodField()
Expand All @@ -659,7 +659,7 @@ class Meta:
tags = TagListSerializerField(required=False, allow_empty=True)

def get_created_at_local(self, obj) -> datetime:
return obj.creation_time_local
return obj.creation_time_local.replace(tzinfo=None)

def get_published(self, obj) -> bool:
return obj.published
Expand Down
4 changes: 2 additions & 2 deletions api/tests/integration/bites/create.tavern.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ stages:
Authorization: "Bearer {app_user_token:s}"
method: "POST"
data: &request_bite_data
created_at: '2024-01-01T00:00:00Z'
created_at: '2024-01-01T01:00:00+01:00'
sent_at: '2024-01-01T00:30:00Z'
location.point: !raw '{"latitude": 41.67419, "longitude": 2.79036}'
location.source: 'auto'
Expand All @@ -58,7 +58,7 @@ stages:
short_id: !anystr
user_uuid: "{app_user.pk}"
created_at: '2024-01-01T00:00:00Z'
created_at_local: '2024-01-01T01:00:00+01:00'
created_at_local: '2024-01-01T01:00:00'
sent_at: '2024-01-01T00:30:00Z'
received_at: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}Z
updated_at: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}Z
Expand Down
2 changes: 1 addition & 1 deletion api/tests/integration/bites/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ variables:
short_id: !anystr
user_uuid: !re_fullmatch "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
created_at: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}Z
created_at_local: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}([+-]\d{2}:\d{2}|Z)
created_at_local: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}
sent_at: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}Z
received_at: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}Z
updated_at: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}Z
Expand Down
4 changes: 2 additions & 2 deletions api/tests/integration/breeding_sites/create.tavern.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ stages:
photos[0]file: "{test_jpg_image_path}"
photos[1]file: "{test_png_image_path}"
data: &request_site_data
created_at: '2024-01-01T00:00:00Z'
created_at: '2024-01-01T01:00:00+01:00'
sent_at: '2024-01-01T00:30:00Z'
location.point: !raw '{"latitude": 41.67419, "longitude": 2.79036}'
location.source: 'auto'
Expand All @@ -62,7 +62,7 @@ stages:
short_id: !anystr
user_uuid: "{app_user.pk}"
created_at: '2024-01-01T00:00:00Z'
created_at_local: '2024-01-01T01:00:00+01:00'
created_at_local: '2024-01-01T01:00:00'
sent_at: '2024-01-01T00:30:00Z'
received_at: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}Z
updated_at: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}Z
Expand Down
2 changes: 1 addition & 1 deletion api/tests/integration/breeding_sites/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ variables:
short_id: !anystr
user_uuid: !re_fullmatch "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
created_at: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}Z
created_at_local: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}([+-]\d{2}:\d{2}|Z)
created_at_local: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}
sent_at: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}Z
received_at: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}Z
updated_at: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}Z
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ variables:
uuid: !re_fullmatch "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
locale: !anystr
created_at: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}Z
created_at_local: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}([+-]\d{2}:\d{2}|Z)
created_at_local: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}
received_at: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}Z
location:
timezone: !anything
Expand Down
2 changes: 1 addition & 1 deletion api/tests/integration/identification_tasks/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ variables:
short_id: !anystr
user_uuid: !re_fullmatch "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
created_at: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}Z
created_at_local: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}([+-]\d{2}:\d{2}|Z)
created_at_local: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}
received_at: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}Z
location:
timezone: !anything
Expand Down
4 changes: 2 additions & 2 deletions api/tests/integration/observations/create.tavern.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ stages:
photos[0]file: "{test_jpg_image_path}"
photos[1]file: "{test_png_image_path}"
data: &request_site_data
created_at: '2024-01-01T00:00:00Z'
created_at: '2024-01-01T01:00:00+01:00'
sent_at: '2024-01-01T00:30:00Z'
location.point: !raw '{"latitude": 41.67419, "longitude": 2.79036}'
location.source: 'auto'
Expand All @@ -61,7 +61,7 @@ stages:
short_id: !anystr
user_uuid: "{app_user.pk}"
created_at: '2024-01-01T00:00:00Z'
created_at_local: '2024-01-01T01:00:00+01:00'
created_at_local: '2024-01-01T01:00:00'
sent_at: '2024-01-01T00:30:00Z'
received_at: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}Z
updated_at: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}Z
Expand Down
2 changes: 1 addition & 1 deletion api/tests/integration/observations/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ variables:
short_id: !anystr
user_uuid: !re_fullmatch "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
created_at: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}Z
created_at_local: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}([+-]\d{2}:\d{2}|Z)
created_at_local: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}
sent_at: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}Z
received_at: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}Z
updated_at: !re_fullmatch \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}Z
Expand Down
Loading