fix: show an int PORT as its digits in the duplicate-database refusal

Open Beginner friendly
#178 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
django, python
Domain
backend, databases

Research direction

Start with databases_problems in neolith/_databases.py, which the reproduction calls directly. The refusal text is built from the PORT value, and the reproduction shows an int port being rejected instead of rendered. Check how the port is validated and formatted there, then run the reproduction snippet. Done when billing and default report on :5432 for an int PORT and existing string-port cases still produce the same messages.

Written by the indexing model from the issue text.

Description

Reproduction

On release/0.1.0a4 (07b71c6):

from neolith._databases import databases_problems

s = {"ENGINE": "django.db.backends.postgresql", "NAME": "n", "PORT": 5432}
databases_problems({"default": s, "billing": dict(s)}, ["billing"])

gives ['databases default and billing: both name django.db.backends.postgresql n on :a value of type int'].

Expected

An exact int port is admitted, so the refusal shows it as its digits: ... n on :5432.

Dominant language
Python
Stars
1
Forks
0
Avg merge
6h 34m
Merged PRs (30d)
108

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stack314/django-neolith

All issues in stack314/django-neolith

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.