Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
owocki committed Apr 8, 2019
1 parent 16781f8 commit 9dbb0ed
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
6 changes: 1 addition & 5 deletions app/app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,7 @@
dashboard.views.profile_job_opportunity,
name='profile_job_opportunity'
),
url(
r'^api/v0.1/bountydocument',
dashboard.views.bounty_upload_nda,
name='bounty_upload_nda'
),
url(r'^api/v0.1/bountydocument', dashboard.views.bounty_upload_nda, name='bounty_upload_nda'),
url(r'^api/v0.1/faucet/save/?', faucet.views.save_faucet, name='save_faucet'),
url(r'^api/v0.1/', include(dbrouter.urls)),
url(r'^api/v0.1/', include(kdrouter.urls)),
Expand Down
17 changes: 12 additions & 5 deletions app/dashboard/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import logging
import time
from datetime import datetime

Expand All @@ -30,6 +31,8 @@
SearchHistory,
)

logger = logging.getLogger(__name__)


class BountyFulfillmentSerializer(serializers.ModelSerializer):
"""Handle serializing the BountyFulfillment object."""
Expand Down Expand Up @@ -359,11 +362,15 @@ def get_queryset(self):
if 'is_featured' not in param_keys:
if self.request.user and self.request.user.is_authenticated:
data['nonce'] = int(time.time() / 1000)
SearchHistory.objects.update_or_create(
user=self.request.user,
data=data,
ip_address=get_ip(self.request)
)
try:
SearchHistory.objects.update_or_create(
user=self.request.user,
data=data,
ip_address=get_ip(self.request)
)
except Exception as e:
logger.debug(e)
pass


return queryset
Expand Down

0 comments on commit 9dbb0ed

Please sign in to comment.