aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2015-09-15 10:38:01 +0300
committerFilipp Lepalaan <filipp@mac.com>2015-09-15 10:38:01 +0300
commit46619ea770fe8da1b6a9e8e233cb81adcebefb3a (patch)
tree6ca3598782fb33455fa1aeedc658b5b9ed905282
parenta2c673fcd4e39210a81abd6b6a51660aba870b26 (diff)
downloadServo-46619ea770fe8da1b6a9e8e233cb81adcebefb3a.tar.gz
Servo-46619ea770fe8da1b6a9e8e233cb81adcebefb3a.tar.bz2
Servo-46619ea770fe8da1b6a9e8e233cb81adcebefb3a.zip
Rooting out Sites
-rwxr-xr-xservo/management/commands/cron.py7
-rw-r--r--servo/views/admin.py5
-rwxr-xr-xstatic/js/servo.js5
3 files changed, 4 insertions, 13 deletions
diff --git a/servo/management/commands/cron.py b/servo/management/commands/cron.py
index e2831e9..519cbb4 100755
--- a/servo/management/commands/cron.py
+++ b/servo/management/commands/cron.py
@@ -92,9 +92,8 @@ class Command(BaseCommand):
now = timezone.now()
limit = now - timedelta(days=1)
- locations = Location.objects.filter(site_id=settings.SITE_ID)
- for l in locations:
+ for l in Location.objects.filter(enabled=True):
table = CsvTable()
table.addheader(['Order', 'Assigned To', 'Status', 'Days red'])
@@ -126,9 +125,7 @@ class Command(BaseCommand):
except KeyError:
raise ValueError('Default sender address not defined')
- locations = Location.objects.filter(site_id=settings.SITE_ID)
-
- for l in locations:
+ for l in Location.objects.filter(enabled=True):
out_of_stock = Inventory.objects.filter(
location=l,
amount_stocked__lt=F('amount_minimum')
diff --git a/servo/views/admin.py b/servo/views/admin.py
index 91f73a9..7d7757e 100644
--- a/servo/views/admin.py
+++ b/servo/views/admin.py
@@ -505,13 +505,12 @@ def create_user_token(request, user_id):
@staff_member_required
def edit_user(request, pk=None):
if pk is None:
- user = User(site_id=app_settings.SITE_ID)
- user.location = request.user.location
+ user = User(location=request.user.location)
user.locale = request.user.locale
user.region = request.user.region
user.timezone = request.user.timezone
else:
- user = User.objects.get(pk=pk)
+ user = get_object_or_404(User, pk=pk)
form = UserForm(instance=user)
diff --git a/static/js/servo.js b/static/js/servo.js
index 9e076c1..ed6be4d 100755
--- a/static/js/servo.js
+++ b/static/js/servo.js
@@ -1,8 +1,3 @@
-/**
- * servo.js
- * (c) 2014 First Party Software LTD
- */
-
$(document).ready(function() {
$('input[type="checkbox"]').click(function(e){