Verified Commit 9cbcc108 authored by Baptiste Beauplat's avatar Baptiste Beauplat
Browse files

Support unsigned uploads (for testing purpose)

parent 62dc554d
...@@ -421,8 +421,7 @@ class Importer(): ...@@ -421,8 +421,7 @@ class Importer():
# match their checksum # match their checksum
try: try:
changes.validate() changes.validate()
if not self.skip_gpg: changes.authenticate(not self.skip_gpg)
changes.authenticate()
if getattr(settings, 'CHECK_NEWER_UPLOAD', True): if getattr(settings, 'CHECK_NEWER_UPLOAD', True):
changes.assert_newer() changes.assert_newer()
changes.files.validate() changes.files.validate()
......
...@@ -86,9 +86,17 @@ class Changes(GPGSignedFile): ...@@ -86,9 +86,17 @@ class Changes(GPGSignedFile):
return False return False
def authenticate(self): def authenticate(self, gpg=True):
if gpg:
super().authenticate() super().authenticate()
self.uploader = User.objects.get(key=self.key) self.uploader = User.objects.get(key=self.key)
else:
user = User.objects.lookup_user_from_address(self.uploader)
if not user:
raise ExceptionChanges(f'No user found for {self.uploader}')
self.uploader = user
def _build_changes(self): def _build_changes(self):
self.dsc = None self.dsc = None
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment