diff --git a/fluent_dashboard/items.py b/fluent_dashboard/items.py index 8c5c225..8cf2585 100644 --- a/fluent_dashboard/items.py +++ b/fluent_dashboard/items.py @@ -113,11 +113,12 @@ def get_edited_object(self, request): return None # object_id can be string (e.g. a country code as PK). - try: - object_id = resolvermatch.kwargs['object_id'] # Django 2.0+ - except KeyError: - object_id = resolvermatch.args[0] - + if 'id' in resolvermatch.kwargs: + object_id = resolvermatch.kwargs['id'] # Django 2.0+ ; for user passwords + elif 'object_id' in resolvermatch.kwargs: + object_id = resolvermatch.kwargs['object_id'] # Django 2.0+ ; for others + else: + object_id = resolvermatch.args[0] # Brought forward return self.get_object_by_natural_key(match.group(1), match.group(2), object_id) return None