Skip to content

Commit

Permalink
Small fixes, changed variable result values table to only include pas…
Browse files Browse the repository at this point in the history
…t 72 hours
  • Loading branch information
fryarludwig committed Nov 13, 2017
1 parent 602c106 commit 5bc97ae
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 32 deletions.
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ django-webtest==1.8.0
django-widget-tweaks==1.4.1
djangorestframework==3.5.3
Markdown==2.6.7
mysqlclient==1.3.9
patterns==0.3
psycopg2==2.7.1
six==1.10.0
Expand Down
2 changes: 1 addition & 1 deletion src/WebSDL/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
print("The secret key is required in the settings.json file.")
exit(1)

ALLOWED_HOSTS = []
ALLOWED_HOSTS = ['*']


# Application definition
Expand Down
Empty file.
28 changes: 0 additions & 28 deletions src/dataloaderinterface/migrations/0002_auto_20170913_0811.py

This file was deleted.

Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ function getTimeSeriesData(sensorInfo) {
complete: function (result) {
if (result.data) {
var recentValues = getRecentData(result.data);
fillValueTable($('table.data-values[data-result-id=' + sensorInfo['resultId'] + ']'), result.data);
fillValueTable($('table.data-values[data-result-id=' + sensorInfo['resultId'] + ']'), recentValues);
drawSparklineOnResize(sensorInfo, recentValues);
drawSparklinePlot(sensorInfo, recentValues);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@

{# View on TSA button #}
{# TODO: (Juan) Add to url patterns #}
<a target="_blank" href="http://envirodiysandbox.usu.edu/tsa/?sitecode={{ site.sampling_feature_code }}&variablecode={{ sensor.variable_code }}&view=visualization&plot=true">
<a target="_blank" href="http://data.envirodiy.org/tsa/?sitecode={{ site.sampling_feature_code }}&variablecode={{ sensor.variable_code }}&view=visualization&plot=true">
<span id="tsa-trigger-{{ forloop.counter0 }}"
class="fa fa-external-link tsa-trigger pull-right white-shadow"
aria-hidden="true"></span>
Expand Down
7 changes: 7 additions & 0 deletions src/dataloaderinterface/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,12 @@ class SiteUpdateView(LoginRequiredMixin, UpdateView):
fields = []

def get_success_url(self):
print 'Getting success url'
return reverse_lazy('site_detail', kwargs={'sampling_feature_code': self.object.sampling_feature_code})

def get_formset_initial_data(self, *args):
if self.get_object().django_user != self.request.user and not self.request.user.is_staff:
raise Http404
registration = self.get_object()
result_form_data = [
{
Expand All @@ -205,6 +208,8 @@ def get_formset_initial_data(self, *args):
return result_form_data

def get_context_data(self, **kwargs):
if self.get_object().django_user != self.request.user and not self.request.user.is_staff:
raise Http404
context = super(SiteUpdateView, self).get_context_data()
data = self.request.POST if self.request.POST else None
sampling_feature = self.get_object().sampling_feature
Expand All @@ -218,6 +223,8 @@ def get_context_data(self, **kwargs):
return context

def post(self, request, *args, **kwargs):
if self.get_object().django_user != self.request.user and not self.request.user.is_staff:
raise Http404
site_registration = SiteRegistration.objects.filter(sampling_feature_code=self.kwargs['sampling_feature_code']).first()
sampling_feature = site_registration.sampling_feature

Expand Down
1 change: 1 addition & 0 deletions src/dataloaderservices/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def authenticate(self, request):
if request.META['REQUEST_METHOD'] != 'POST':
return None

print 'Request data: {}'.format(request.data)
if 'HTTP_TOKEN' not in request.META:
raise exceptions.ParseError("Registration Token not present in the request.")
elif 'sampling_feature' not in request.data:
Expand Down
Empty file.

0 comments on commit 5bc97ae

Please sign in to comment.