You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
541 B
Python
21 lines
541 B
Python
import json
|
|
from channels.generic.websocket import AsyncWebsocketConsumer
|
|
|
|
class EncryptedValueConsumer(AsyncWebsocketConsumer):
|
|
async def connect(self):
|
|
await self.accept()
|
|
|
|
async def receive(self, text_data):
|
|
data = json.loads(text_data)
|
|
decrypted_value = data['decrypted_value']
|
|
|
|
|
|
|
|
status = self.decryption_equals_X(decrypted_value)
|
|
await self.send(text_data=json.dumps({
|
|
'status': status
|
|
}))
|
|
|
|
|
|
def decryption_equals_X(self, x_decrypted):
|
|
return True |