-
-
Notifications
You must be signed in to change notification settings - Fork 771
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
small tip tweaks #2111
small tip tweaks #2111
Conversation
owocki
commented
Aug 28, 2018
- stores user agent
- makes searchable by ip and metadata
app/dashboard/admin.py
Outdated
@@ -77,7 +77,7 @@ class TipAdmin(admin.ModelAdmin): | |||
raw_id_fields = ['recipient_profile', 'sender_profile'] | |||
ordering = ['-id'] | |||
readonly_fields = ['resend', 'claim'] | |||
search_fields = ['tokenName', 'comments_public', 'comments_priv', 'from_name', 'username', 'network', 'github_url', 'url', 'emails', 'from_address', 'receive_address'] | |||
search_fields = ['tokenName', 'comments_public', 'comments_priv', 'from_name', 'username', 'network', 'github_url', 'url', 'emails', 'from_address', 'receive_address', 'ip', 'metadata'] |
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.
E501 line too long (189 > 120 characters)
Codecov Report
@@ Coverage Diff @@
## master #2111 +/- ##
==========================================
- Coverage 27.91% 27.91% -0.01%
==========================================
Files 136 136
Lines 11130 11132 +2
Branches 1499 1499
==========================================
Hits 3107 3107
- Misses 7913 7915 +2
Partials 110 110
Continue to review full report at Codecov.
|
app/dashboard/tip_views.py
Outdated
@@ -290,6 +290,10 @@ def send_tip_3(request): | |||
to_emails = list(set(to_emails)) | |||
expires_date = timezone.now() + timezone.timedelta(seconds=params['expires_date']) | |||
|
|||
# metadata | |||
metadata = params['metadata'] | |||
metadata['user_agent'] = request.META['HTTP_USER_AGENT'] |
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.
🤔 - HTTP_USER_AGENT
should always be present in the META
. This shouldn't be a problem.