princekhunt / privateping

PrivatePing is a secure messaging application built on Python's Django framework, providing end-to-end encryption for messages exchanged between users.
https://privateping.bytespot.tech
MIT License
124 stars 30 forks source link

Configure DEFAULT_AUTO_FIELD to prevent auto-created primary key warnings #50

Closed snipher-marube closed 4 days ago

snipher-marube commented 5 days ago

Summary

This pull request addresses the Django models.W042 warnings that occur when the default primary key type is not explicitly defined. The warnings were observed in the preventconcurrentlogins.Visitor and registration.user_type models.

Details

These changes ensure that the primary key type is explicitly defined, preventing Django from auto-creating primary keys and eliminating the associated warnings.

Changes Made

  1. Updated settings.py:
    DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

Testing

This change is backward compatible and does not affect existing migrations or data. It's recommended to run makemigrations and migrate to ensure that any new models created will use the BigAutoField by default.

Thank you for considering this contribution!