-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
@artemiy312 , this is single interesting commit for review. All other is about cloning and bunch renaming |
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.
@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.
redirects/admin.py
Outdated
@@ -0,0 +1,10 @@ | |||
from django.contrib import admin | |||
from redirects.models import Redirect |
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 add one line before project imports
generic_admin/mixins.py
Outdated
@@ -1,5 +1,5 @@ | |||
from django.contrib import admin | |||
from django.contrib.redirects.models import Redirect | |||
from redirects.models import Redirect |
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.
An project import should be separate
@artemiy312 , oops ... You are right of course. We can inject cusom Middleware, i missed this django feature. I'll fix this PR |
42455ee
to
2a4d664
Compare
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.
@duker33 , please, pay attention on the comment about a name of middleware class
refarm_redirects/middleware.py
Outdated
from django.contrib.sites.shortcuts import get_current_site | ||
|
||
|
||
class RedirectFallbackMiddleware(DjangoRedirectFallbackMiddleware): |
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.
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
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.
@artemiy312 , i'll change it to RedirectAllMiddleware
, y
TO-DO
Closes #140