models.py 658 B

1234567891011121314151617181920212223
  1. from django.db import models
  2. from glitchtip.base_models import CreatedModel
  3. class DebugInformationFile(CreatedModel):
  4. """
  5. It hold info of the uploaded debug information file
  6. """
  7. name = models.TextField()
  8. project = models.ForeignKey("projects.Project", on_delete=models.CASCADE)
  9. file = models.ForeignKey("files.File", on_delete=models.CASCADE)
  10. data = models.JSONField(null=True, blank=True)
  11. class Meta:
  12. indexes = [models.Index(fields=["project", "file"])]
  13. def is_proguard_mapping(self):
  14. try:
  15. return self.data["symbol_type"] == "proguard"
  16. except Exception:
  17. return False