-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Harry #78
Harry #78
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Harry, this looks great to me, congratulations on the first PR :)
First some suggestions on using git:
- Ideally, create one branch per issue / bugfix / feature. Sometimes it makes sense to do a few together where they are related, but if not, best to do them in separate branches.
- Give the branch a nice descriptive name, like
remove-trailing-slashes
orconfigurable-contact-details
for example. - Give the PR a meaningful title e.g.
Remove dangling slashes from URL patterns
. The general approach in git is to try to keep this under 80 characters, although you can treat that as a guideline rather than a hard and fast rule. This will be the one line of text you see next to the commit in the abridged view of the git history, so it's important that it says what the PR does very clearly. - Give the PR a good description (actually you did this, so thank you). If it fixes a Github ticket, you can write a final line that say
Fixes #47
. This will automatically link the Github issue and when the PR is merged, it will auto-close the issue as well.
You'll find 3&4 to be good guidelines to follow for all commits, not just when submitting PRs.
Now moving on to the actual code. It basically all looks fine to me. I'd like to test it myself on my dev server before merging, which I haven't done yet, but based on what I'm seeing it all looks good. I've made a couple of suggestions inline in the code.
A final thing: make sure you run make format
before you commit. It enforces some code-style rules. You can run it again now and do a fresh commit to this PR to fix the issues it flags up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is amazing, and really helpful. I'd like to suggest though that rather than committing this to the repo, can we have a command in the Makefile
to generate it on the fly, and have it (and the HTML version in the next file) be in .gitignore
so they don't get checked in to the repo. My reason for suggesting it this way is then we can all regenerate this whenever we want very easily, but won't clutter up the repo with commits changing the file / have potentially out-of-date versions in the repo, because this diagram is going to change quite often - whenever we make a model change).
Happy to help if you're not sure how to do it, but my suggestion would be:
- Add the package that's needed to build this to the dependencies (the
dev
group specifically) withpoetry
. - Create a command in the
Makefile
calledmake generate-entity-relationship-diagram
or similar, that runs the command to generate these files. - Add
carshare-er.svg
andentity_relationship_diagram.html
to.gitignore
so that they don't get committed.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have done this, however it requires installing graphviz on your machine to convert the dot file produced by django-extensions.
CONTACT_PHONE = '01720 575 301' | ||
CONTACT_CARSHARE_EMAIL = '[email protected]' | ||
CONTACT_EMAIL = '[email protected]' | ||
CONTACT_INTERNATIONAL_PHONE = '+441720575301' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get rid of this one and just use the UK format phone number everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one place where a tel href is used, I believe this needs the number in this format to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh that makes sense.
@@ -265,3 +266,9 @@ def env_get_list(variable, default): | |||
}, | |||
}, | |||
} | |||
|
|||
# contact details | |||
CONTACT_PHONE = '01720 575 301' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make these be read from the environment? e.g.
CONTACT_PHONE = os.environ.get("CONTACT_PHONE", "01111 222 333")
Then we can take actual IOSCV information out of the source code here and instead load it through our environment variable config instead.
# contact details | ||
CONTACT_PHONE = '01720 575 301' | ||
CONTACT_CARSHARE_EMAIL = '[email protected]' | ||
CONTACT_EMAIL = '[email protected]' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one doesn't look like it's used anywhere in the PR? If it's not needed, can we just call the other one CONTACT_EMAIL
and do away with this one?
Issue 76 - added context processor for contact details and edited templates to use values set in settings.
Issue 47 - added dangling slashes to urls as this seems to be considered less ambiguous
Created an entity relationship diagram using django-extensions, rendered it as an SVG and created an html file that allows panning and zooming.