# HG changeset patch # User ymh # Date 1435859337 -7200 # Node ID eff2287e93fb24b194afe8f0fb0ee6e7984da4d6 # Parent bed872f13d1fc77a9019705e33fd3de5c3c77132 correct some small problems with urls in mails. set final version diff -r bed872f13d1f -r eff2287e93fb src/hdabo/management/commands/import_rdf.py --- a/src/hdabo/management/commands/import_rdf.py Tue Jun 23 02:24:56 2015 +0200 +++ b/src/hdabo/management/commands/import_rdf.py Thu Jul 02 19:48:57 2015 +0200 @@ -838,14 +838,13 @@ if any([t not in TYPES_LIST for t in self.types_list]): raise CommandError("Types is %r : all types mus be in %r" % (self.types_list, TYPES_LIST)) - connection = connections[DEFAULT_DB_ALIAS] - sql_temp, _ = connection.creation.sql_create_model(ProcessedObjects, no_style(), []) - cursor = connection.cursor() - for stmt in sql_temp: - cursor.execute(stmt.replace("CREATE TABLE", "CREATE TEMPORARY TABLE")) + with transaction.atomic(): + connection = connections[DEFAULT_DB_ALIAS] + sql_temp, _ = connection.creation.sql_create_model(ProcessedObjects, no_style(), []) + cursor = connection.cursor() + for stmt in sql_temp: + cursor.execute(stmt.replace("CREATE TABLE", "CREATE TEMPORARY TABLE")) - transaction.set_dirty() - transaction.commit() #lines = options.get('lines', 0) #self.ignore_existing = options.get('ignore_existing', False) @@ -923,7 +922,6 @@ print(" Obj: {object_name} -> created: {created:d}, updated: {updated:d}, deleted: {deleted:d}, untouched: {untouched:d}".format(**obj_stat)) print("") - #print(graph_disk_cache.temp_folder) shutil.rmtree(graph_disk_cache.temp_folder) -#] + diff -r bed872f13d1f -r eff2287e93fb src/hdalab/__init__.py --- a/src/hdalab/__init__.py Tue Jun 23 02:24:56 2015 +0200 +++ b/src/hdalab/__init__.py Thu Jul 02 19:48:57 2015 +0200 @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import -VERSION = (3, 0, 0, "rc", 17) +VERSION = (3, 0, 0, "final", 0) def get_version(): diff -r bed872f13d1f -r eff2287e93fb src/hdalab/config.py.tmpl --- a/src/hdalab/config.py.tmpl Tue Jun 23 02:24:56 2015 +0200 +++ b/src/hdalab/config.py.tmpl Thu Jul 02 19:48:57 2015 +0200 @@ -30,6 +30,8 @@ BASE_DIR = os.path.dirname(os.path.abspath(__file__)).rstrip("/") + "/" BASE_URL = '/~ymh/hdabo/' WEB_URL = 'http://localhost' +#used when need to resolve url outside web context (in a commmand for example) +SCRIPT_PREFIX = BASE_URL + 'hdalab' LOCALE_PATHS = ( os.path.join(BASE_DIR, 'locale',), ) diff -r bed872f13d1f -r eff2287e93fb src/hdalab/management/commands/send_moderation_mail.py --- a/src/hdalab/management/commands/send_moderation_mail.py Tue Jun 23 02:24:56 2015 +0200 +++ b/src/hdalab/management/commands/send_moderation_mail.py Thu Jul 02 19:48:57 2015 +0200 @@ -13,6 +13,7 @@ from django.core import mail from django.core.mail.message import EmailMultiAlternatives from django.core.management.base import NoArgsCommand +from django.core.urlresolvers import set_script_prefix from django.template.base import TemplateDoesNotExist from django.template.loader import render_to_string import premailer @@ -28,6 +29,8 @@ def handle_noargs(self, **options): # query renkan to moderate + set_script_prefix(settings.SCRIPT_PREFIX) + renkan_query = HdalabRenkan.objects.filter(state=HdalabRenkan.MODERATED) renkan_count = renkan_query.count()