Skip to content

Conversation

@rhodges
Copy link
Member

@rhodges rhodges commented May 17, 2025

No description provided.

rhodges added 26 commits May 8, 2025 19:05
… rather than hardcode (13 does match my manual count)
…in Admin. Creating 'ITKTestCase' class to repeat dummy data loading
…self' iframes and subdomains of a given domain
@rhodges rhodges requested a review from Copilot May 17, 2025 00:14
@rhodges rhodges self-assigned this May 17, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

A version bump to 2.2.2, security header tweaks, test fixture loading refactor, and a new DefaultModel base class with model inheritance updates.

  • Adjusted Nginx security headers (commented out X-Frame-Options, broadened CSP).
  • Replaced Django fixture declarations with a custom import_fixture_file helper in tests.
  • Introduced DefaultModel to auto-reset DB sequences on unique-constraint errors and applied it across models.
  • Refactored admin bulk-upload tests to use RequestFactory and bumped VERSION in settings.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
deployment/tekdb_nginx.conf Commented out X-Frame-Options, updated Content-Security-Policy header
TEKDB/explore/tests/test_views.py Switched from fixture list to import_fixture_file, added join import
TEKDB/TEKDB/tests/test_views.py Added JSON content-type/permission remapping helpers and import_fixture_file
TEKDB/TEKDB/tests/test_admin.py Rewrote media bulk upload tests using RequestFactory and admin API
TEKDB/TEKDB/settings.py Updated VERSION from 2.2.0 to 2.2.2
TEKDB/TEKDB/models.py Added DefaultModel, changed many models to inherit new bases
Comments suppressed due to low confidence (5)

TEKDB/TEKDB/models.py:294

  • [nitpick] The base class name Lookup is very generic and may collide with other concepts. Consider a more descriptive name, such as LookupModelBase or AbstractLookup.
class Lookup(DefaultModel, DefaultModeratedModel, ModeratedModel):

TEKDB/TEKDB/tests/test_views.py:287

  • The PlaceMapTest is fully commented out, leaving no coverage for the placeMap view. Either reinstate or replace this test to ensure the endpoint remains verified.
### 2025-05-09: No one has any idea what a 'placeMap' is.

deployment/tekdb_nginx.conf:7

  • By commenting out the X-Frame-Options header, clickjacking protection is disabled unless covered by CSP. Consider removing the comment to restore it or ensure CSP frame-ancestors covers all hosts securely.
# add_header X-Frame-Options "SAMEORIGIN";

TEKDB/explore/tests/test_views.py:9

  • The import path TEKDB.tests.test_views doesn't match the actual module location (TEKDB/TEKDB/tests/test_views.py). Update to the correct module path so the helper can be found.
from TEKDB.tests.test_views import import_fixture_file

TEKDB/explore/tests/test_views.py:20

  • The settings module is not imported in this file, which will cause a NameError. Add from django.conf import settings at the top.
import_fixture_file(join(settings.BASE_DIR, 'TEKDB', 'fixtures', 'all_dummy_data.json'))

…t clickjacking -- Content-Security-Policy may not be enough
rhodges and others added 2 commits May 16, 2025 17:27
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@rhodges rhodges merged commit 240e479 into main May 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants