core: make request in context optional for Applications API
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org> #3482
This commit is contained in:
parent
c3c8cbf7ef
commit
5886688fae
|
@ -50,7 +50,9 @@ class ApplicationSerializer(ModelSerializer):
|
|||
|
||||
def get_launch_url(self, app: Application) -> Optional[str]:
|
||||
"""Allow formatting of launch URL"""
|
||||
user = self.context["request"].user
|
||||
user = None
|
||||
if "request" in self.context:
|
||||
user = self.context["request"].user
|
||||
return app.get_launch_url(user)
|
||||
|
||||
class Meta:
|
||||
|
|
Reference in New Issue