Hipo/django-sloop

Push Message admin should be fully read only

Closed this issue · 4 comments

We need to remove device field from readonly_fields in PushMessageAdmin since it is a required field and if it is not populated we get the

null value in column "device_id" violates not-null constraint

error while trying to create a new PushMessage instance.

Code reference: https://github.com/Hipo/django-sloop/blob/master/django_sloop/admin.py#L128

@ozandogrultan It's designed to be read only in the admin level. You want to create push message object through django admin right?

Alternatively you might try to send push notification which will create push message object.

Yes, I have discovered this issue while trying to send push messages.

Do you think it would be more clear if we make all fields of PushMessage read-only in the ModelAdmin then? Was there a purpose for making data and sns_response writable?

Do you think it would be more clear if we make all fields of PushMessage read-only in the ModelAdmin then?

Indeed.

Was there a purpose for making data and sns_response writable?

No, it was not in purpose.

Maybe we should change the issue as "Push Message admin should be fully read only."