fix bug: if regex.search(value): TypeError: expected string or bytes…#87
Open
sunwenquan wants to merge 1 commit intojazzband:masterfrom
Open
fix bug: if regex.search(value): TypeError: expected string or bytes…#87sunwenquan wants to merge 1 commit intojazzband:masterfrom
sunwenquan wants to merge 1 commit intojazzband:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #87 +/- ##
==========================================
+ Coverage 93.84% 93.88% +0.04%
==========================================
Files 10 10
Lines 276 278 +2
Branches 31 32 +1
==========================================
+ Hits 259 261 +2
Misses 11 11
Partials 6 6
Continue to review full report at Codecov.
|
Collaborator
|
Can you explain why this change is needed? What caused user_agent to be |
Author
When I visited http://localhost:8000/account/sessions/For example
|
Collaborator
|
That's not normal behaviour. Please investigate why the usage agent has not been set for that user. This could be caused by another issue altogether. |
|
@Bouke to raise this issue from the dead, I have found that this issue can arise when using the django testing framework to render a page - the user agent is not necessarily set e.g. def some_test(self):
self.client.get("/page/")leads to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix the following exception information.
Description
In user_sessions/templatetags/user_sessions.py,line 58,when value is None, python throws an exception. I added the following code in front to solve this problem.
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: