diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-10-19 10:21:03 +0100 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-10-19 10:21:03 +0100 |
commit | b02ea665d8ecce3b326dc0b245027a0ce4c2de29 (patch) | |
tree | 0aa2915ee6f542d80d49d1986e0c213779313dd7 /ctrack/register/views.py | |
parent | 229e08df8e7454bbc7fcd545349bb6802e841db5 (diff) |
fixed failing test
Diffstat (limited to '')
-rw-r--r-- | ctrack/register/views.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ctrack/register/views.py b/ctrack/register/views.py index db018b2..b601c49 100644 --- a/ctrack/register/views.py +++ b/ctrack/register/views.py @@ -78,8 +78,12 @@ class SingleDateTimeEventCreate(FormView): success_url = reverse_lazy("organisations:list") def get_success_url(self): - self.success_url = reverse_lazy("organisations:detail", args=[self.kwargs["org_slug"]]) - return super().get_success_url() + # We might not have org_slug if we are not setting this from an org detail page + try: + self.success_url = reverse_lazy("organisations:detail", args=[self.kwargs["org_slug"]]) + return super().get_success_url() + except KeyError: + return super().get_success_url() def get_context_data(self, **kwargs): context = super().get_context_data() |