aboutsummaryrefslogtreecommitdiff
path: root/app/dispatch/monkey_patch.py
diff options
context:
space:
mode:
authorMitch Riedstra <Mitch@riedstra.us>2017-10-30 17:06:23 -0400
committerMitch Riedstra <Mitch@riedstra.us>2017-10-30 17:06:23 -0400
commitec9428fdf76b5d70d0f3bcdff3b85e3a83d5f3d5 (patch)
tree6ae862656a003d683f537d078599f98bbfa2675d /app/dispatch/monkey_patch.py
parent1949503b55ea622d7c466e4b433f4d90e7eff125 (diff)
downloaddispatch-tracker-ec9428fdf76b5d70d0f3bcdff3b85e3a83d5f3d5.tar.gz
dispatch-tracker-ec9428fdf76b5d70d0f3bcdff3b85e3a83d5f3d5.tar.xz
Proper redirect on edit for users. Delete for loads, warning on delete. Invoice view ordered by PK desc
Diffstat (limited to 'app/dispatch/monkey_patch.py')
-rw-r--r--app/dispatch/monkey_patch.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/dispatch/monkey_patch.py b/app/dispatch/monkey_patch.py
new file mode 100644
index 0000000..3b87287
--- /dev/null
+++ b/app/dispatch/monkey_patch.py
@@ -0,0 +1,7 @@
+from django.contrib.auth.models import User
+from django.core.urlresolvers import reverse
+
+def get_absolute_url(self):
+ return reverse('driver_details', kwargs={'pk': self.pk})
+
+User.add_to_class("get_absolute_url", get_absolute_url)