Skip to content
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

#140 Clone redirects app #141

Merged
merged 3 commits into from
Jul 3, 2018
Merged

#140 Clone redirects app #141

merged 3 commits into from
Jul 3, 2018

Conversation

duker33
Copy link
Collaborator

@duker33 duker33 commented Jun 22, 2018

Closes #140

@duker33 duker33 self-assigned this Jun 22, 2018
@duker33 duker33 requested a review from ArtemijRodionov June 22, 2018 13:51
@duker33
Copy link
Collaborator Author

duker33 commented Jun 22, 2018

@artemiy312 , this is single interesting commit for review. All other is about cloning and bunch renaming
7794b08

Copy link
Contributor

@ArtemijRodionov ArtemijRodionov left a comment

Choose a reason for hiding this comment

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

@duker33 , As I understood you inherited a whole redirect django app to override only one middleware's method, itsn't it? If it's so, why did not you inherit only related middleware class and override the needed method.

@@ -0,0 +1,10 @@
from django.contrib import admin
from redirects.models import Redirect
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add one line before project imports

@@ -1,5 +1,5 @@
from django.contrib import admin
from django.contrib.redirects.models import Redirect
from redirects.models import Redirect
Copy link
Contributor

Choose a reason for hiding this comment

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

An project import should be separate

@duker33
Copy link
Collaborator Author

duker33 commented Jul 1, 2018

you inherited a whole redirect django app ...

@artemiy312 , oops ... You are right of course. We can inject cusom Middleware, i missed this django feature.

I'll fix this PR

@duker33 duker33 added the refine issue already have resolving code, but code needs some fixes label Jul 1, 2018
@duker33 duker33 requested a review from ArtemijRodionov July 3, 2018 13:30
@duker33 duker33 added the review waits for review label Jul 3, 2018
Copy link
Contributor

@ArtemijRodionov ArtemijRodionov left a comment

Choose a reason for hiding this comment

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

@duker33 , please, pay attention on the comment about a name of middleware class

from django.contrib.sites.shortcuts import get_current_site


class RedirectFallbackMiddleware(DjangoRedirectFallbackMiddleware):
Copy link
Contributor

Choose a reason for hiding this comment

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

Fallback is the wrong part of the class name here, because the PR removes that fallback-like logic in favor of precondition check an existence of redirects

Copy link
Collaborator Author

@duker33 duker33 Jul 3, 2018

Choose a reason for hiding this comment

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

@artemiy312 , i'll change it to RedirectAllMiddleware, y

TO-DO

@duker33 duker33 removed the review waits for review label Jul 3, 2018
@duker33 duker33 merged commit 0356ee6 into master Jul 3, 2018
@duker33 duker33 deleted the 140_clone_redirects_app branch July 3, 2018 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refine issue already have resolving code, but code needs some fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants